java.sql.SQLException: Exhausted Resultset

I get the error java.sql.SQLException: Exhausted ResultSet to run a query against an Oracle database. The connection is via a connection pool defined in Websphere. The code executed is as follows: if (…

How to quote/escape identifiers such as column names with JDBC?

Different database servers use different ways to quote and escape identifiers. E.g. “foo bar” vs `foo bar` vs [foo bar], or “10””” vs “10””, or identifiers such as FooBar or array need to be quoted …

PreparedStatement setNull(..)

Java PreparedStatement provides a possibility to explicitely set a Null value. This possibility is: prepStmt.setNull(parameterIndex, Types.VARCHAR); Are the semantics of this call the same as when …

How do I manually configure a DataSource in Java?

I’m trying to follow Sun’s JDBC tutorial at http://java.sun.com/docs/books/tutorial/jdbc/basics/connecting.html It gives the following example code: DataSource ds = (DataSource) org.apache.derby….