Problem with creating language by JDBC

From: "Ming Deng" <mdeng(at)rim(dot)com>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Problem with creating language by JDBC
Date: 2010-06-24 17:44:53
Message-ID: 37335766762332458F9F59CD831915BC04F2FAAA@XCH28YOW.rim.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi there,

I was trying to create language by execute() or executeUpdate(). But the
call always fails with message as

problem running SQL query: CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql'
HANDLER plpgsql_call_handler
.An I/O error occured while sending to the backend.

Following is a snippet of the Java code I have, which works with
creating database, executing other queries:

PreparedStatement stmt = null;
ResultSet rs = null;
try {
stmt = con.prepareStatement(str);
System.out.println("Running SQL query: " + str +
"..");
try {
//stmt.executeUpdate();
stmt.execute();
} catch (SQLException sqle) {
StringBuffer errMsg = new StringBuffer(
" problem running SQL
query: " + str + ".");
errMsg.append(sqle.getMessage());
System.err.println(errMsg.toString());
ret = false;
}
con.commit();
System.out.println("Query is done.");
} finally {

I'm using postgresql-8.2dev-501.jdbc3.jar and querying against an 8.3.4
server. If I run the query manually on psql command with same
authentication, it will return successfully. I tried with a later JDBC
driver, it has the same problem.

Regards,

M.

---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Thomas Kellerer 2010-06-24 21:38:10 Re: Problem with creating language by JDBC
Previous Message Kevin Grittner 2010-06-24 12:09:13 Re: connect postgresql databse through jdbc