Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postgres Exception : No results were returned by the query.

I am trying to insert some rows in to a table... I am using postgressql-7.2.jar.

I get the following exception

org.postgresql.util.PSQLException: No results were returned by the query.
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:255)

I have already Googled and the possible reasons suggested are

  1. Use executeUpdate() method or execute() method instead of executeQuery() method.

  2. This could possibly be because of jar problem; try other versions of postgres jars.

  3. In some places they save it could be because of heap space error.

I have tried all the three solutions but none of them work...

I am not pasting the code since I have just used statement.executeUpdate(queryString). The insert statements load the data in to the table but still I get this error.

Can some one help me out in this?

like image 810
Balaji.N.S Avatar asked Sep 26 '10 14:09

Balaji.N.S


1 Answers

What type of SQL statement are you trying to run with executeQuery()? It should not be an INSERT or UPDATE - these are not queries.

Without posting the actual SQL statement, code samples, or what the table looks like - it's pretty hard to actually help you with your problem. Without specifics all we can do is guess.

like image 192
matt b Avatar answered Sep 23 '22 00:09

matt b