Skip to content
Advertisement

Postgres – Column out of range in PreparedStatement – java

got a problem with a preparedstatement using Java 1.7.0.67 on Windows 8.1…

Basically I get an error as follows (from the test):

JavaScript

I can see it’s telling me I have no ? but they are there for all to see in the before setString message.

Can anyone see what is wrong with what I’m doing – I’m new to PreparedStatements and I think it’s right…

thanks and regards Seán

JavaScript

Advertisement

Answer

Your query should be like

JavaScript

Also you cannot have prepared statement for table names as it is only for column values

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement