commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Edlich" <>
Subject [DbUtils] 2 Questions
Date Thu, 18 Mar 2004 21:50:16 GMT
Dear DbUtils Crew or Users,

I have 2 perhaps simple questions:

1. I have slight problems running the DbUtil Tools from the first website
No problem occurs when using the BeanHandler as a Result Set Handler
to get just one bean back. This is well done.

But the example on the website should return an object array but it crashes.
The result set looks fine but the new ResultSetHandler calls rs.getObject(i
+ 1);
which causes the following exception:
java.sql.SQLException: No data is available Query: SELECT * FROM Person
WHERE age=37 Parameters: [
	at org.apache.commons.dbutils.QueryRunner.rethrow(
	at org.apache.commons.dbutils.QueryRunner.query(
	at org.apache.commons.dbutils.QueryRunner.query(
	at de.commonsbuch.dbutils.Read2BeanArray.main(
I am running hsqldb1.7.1 but the error might be thrown by
Any idea what's could be wrong?

2. If you like to query for an Integer and you are using replacement
parameters with this
query method:
query(java.sql.Connection conn, java.lang.String sql, java.lang.Object
param, ResultSetHandler rsh) 
          Execute an SQL SELECT query with a single replacement parameter.

How do you enter an Integer to search for? (new Integer(37)) won't work.

Thanks in advance
Stefan E


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message