Skip to content
Advertisement

Tag: prepared-statement

Java PreparedStatement preserve table name casing

I have this Java snippet, running inside a WildFly server backed by MariaDB: which gives me the following exception: So, apparentally, it decided to uppercase the table name, which I don’t want. How can I turn it off? Answer That is not possible, SQL dialects are – usually – case insensitive by default, but store the table name in uppercase

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 send a JDBC NULL (a generic SQL NULL)

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 you can

Advertisement