Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
507 views
in Technique[技术] by (71.8m points)

java - 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...