commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikhail Krivoshein <>
Subject [DbUtils] DbUtils.close methods
Date Wed, 02 Jun 2004 10:18:08 GMT
Hello all,

Message of Petr Hollay forced me to consider is it right to throw 
SQLException from QueryRunner.query(), .update() etc in case of error in 

To be clear I'd like to say that I'm developing premium content delivery 
system now. So if you will devliver content - you will get some money, 
if you won't deliver - you will get nothing, except expenses. In such 
content I'd like to send content even if I got some error during 
ResultSet, PreparedStatement and/or Connection close operations. But if 
current design it is unpossible to distinguish such case and case when 
another database errors occur.

Considering this I'm asking for more structured Exceptions handling in 
DbUtils library. At least in QueryRunner.
Good solution is to define set of custom exception classes 
(ConnectionException, QueryException, CloseExceptions, etc) and embedd 
actual SQLException objects into them as cause property value. But it 
makes current version of DbUtils incompatible with
previous versions.

Another solution is to derive all this custom exception classes from 
SQLException, so old applications remains compatible.

Looking forward for comments.

Best regards,
Mikhail Krivoshein

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

View raw message