From: | Sriganesh Ananth <sriganesh(dot)ananth4u(at)gmail(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Postgres 7.3 to 8.1.1 migration: Getting 'No results were returned..' for function calls |
Date: | 2009-04-27 18:40:39 |
Message-ID: | 99ab299e0904271140yb725c3rb36ccce1e048b03c@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi Group,
I am in the process of migrating Postgres from version 7.3 to 8.1.1 on
the Linux 5 server with JDK 1.6 installed and I am using
“postgresql-8.3-604.jdbc4.jar”.
When I try to call a Postgres function from my Java code I am
receiving the following error.
org.postgresql.util.PSQLException: No results were returned by the query.
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:236)
at com.echospace.wizard.db.WizardJDBCConnection.doStoredQuery(WizardJDBCConnection.java:251)
When I execute the query from the Postgres 8.1.1 Admin tool I received
1 row with the message“<unnamed portal 1>”. Also the same query and
code is working fine on the Postgres 7.3 with JDK 1.4.
My query to call the function looks like “BEGIN; SELECT
Get_options('1234','D','123456');” I have also tried executing this
query on Postgres 7.3 admin tool and received “<unnamed cursor 1>”
message.
Java code for executing the function looks like this.
public static StoredQueryResult doStoredQuery( String query ,
Connection db_connection) throws WizardDatabaseException {
String orginalQuery = query;
Statement statement = null;
try {
statement = db_connection.createStatement();
}
catch ( Exception e ) {
throw new WizardDatabaseException( "Error getting statement for
database query.", e );
}
// do the query, and get the cursor
ResultSet result = null;
String cursor = null;
query = "BEGIN; " + query;
Exception exceptionToThrow = null;
try {
result = statement.executeQuery(query);
}
catch ( SQLException ex ) {…..}
I would really appreciate your help in resolving this issue
Thank you for your help in advance.
Regards
Sriganesh
From | Date | Subject | |
---|---|---|---|
Next Message | Joshua D. Drake | 2009-04-27 18:43:29 | Re: PostgreSQL Object-Oriented Database? |
Previous Message | marcin mank | 2009-04-27 18:37:21 | Re: PostgreSQL Object-Oriented Database? |