Skip to content

Tag: prepared-statement

PreparedStatement setNull(..)

Java PreparedStatement provides a possibility to explicitely set a Null value. This possibility is: Are the semantics of this call the same as when using a specific setType with a null parameter? ? Answer This guide says: 6.1.5 Sending JDBC NULL as an IN parameter The setNull method allows a programmer to sen…

Using Prepared Statements to set Table Name

I’m trying to use prepared statements to set a table name to select data from, but I keep getting an error when I execute the query. The error and sample code is displayed below. Any thoughts on what might be causing this? Answer A table name can’t be used as a parameter. It must be hard coded. So…