Hi,
Lately i had this exception in my spring jdbc part of code. What it
actually means is that your query probably doesn't return any value while you are trying to assign the query result into let's say 'int'.
Change the query from queryForInt to regular query that returns a list. Use row mapper also.
Check the list, if it's empty, nothing returned from the query, decide what to do, else if the list isn't empty
and contain data, also, decide what to do.
It then will work for you.
Hoped i helped,
Dor
Showing posts with label database. Show all posts
Showing posts with label database. Show all posts
Jan 4, 2011
org.postgresql.util.PSQLException: ERROR: syntax error at or near
This happen when you have a name which is a reserved name or already exists by a table for example.
Lets say your are trying to add a new table and the error was:
org.postgresql.util.PSQLException: ERROR: syntax error at or near "User"
You got this error since the postgresql in the current schema has already a User table and this name is reserved.
Change your table (if in your case like this example, it's a table issue) name to a different.
Hoped it helps.
Dor
Lets say your are trying to add a new table and the error was:
org.postgresql.util.PSQLException: ERROR: syntax error at or near "User"
You got this error since the postgresql in the current schema has already a User table and this name is reserved.
Change your table (if in your case like this example, it's a table issue) name to a different.
Hoped it helps.
Dor
Subscribe to:
Posts (Atom)