* @return ResultSet :containing the result of the db query
* @throws DbHandlerException
*/
public ResultSet executeQuery(String sqlQuery) throws DbHandlerException {
if (this.transactionInProgress) {
throw new DbHandlerException("Cannot execute, a transaction is "
+ "in progress");
}
try {
if (con == null || con.isClosed()) {
con = ds.getConnection();
}
if (logger.isDebugEnabled()) {
logger.log(Level.DEBUG, "executeQuery: " + sqlQuery);
}
stmt = con.createStatement();
rs = stmt.executeQuery(sqlQuery);
} catch (SQLException sqle) {
throw new DbHandlerException(
"DbHandler - executeQuery: Error getting connection\n"
+ sqle.getMessage(), sqle.getSQLState(), sqle.getErrorCode(),
sqlQuery);
}
return rs;