* @param stmt Statemnt
* @param sql Sql-String
* @return ResultSet
- * @exception StorageObjectException, SQLException
+ * @exception StorageObjectException
*/
- public ResultSet executeSql (Statement stmt, String sql) throws StorageObjectException,
- SQLException {
+ public ResultSet executeSql (Statement stmt, String sql)
+ throws StorageObjectException, SQLException
+ {
+ ResultSet rs;
long startTime = (new java.util.Date()).getTime();
- ResultSet rs = stmt.executeQuery(sql);
- theLog.printInfo((new java.util.Date().getTime() - startTime) + "ms. for: "
+ try {
+ rs = stmt.executeQuery(sql);
+ theLog.printInfo((new java.util.Date().getTime() - startTime) + "ms. for: "
+ + sql);
+ }
+ catch (SQLException e)
+ {
+ theLog.printDebugInfo("Failed: " + (new java.util.Date().getTime() - startTime) + "ms. for: "
+ sql);
+ throw e;
+ }
+
return rs;
}
*/
public ResultSet executeSql (PreparedStatement stmt) throws StorageObjectException,
SQLException {
+
long startTime = (new java.util.Date()).getTime();
ResultSet rs = stmt.executeQuery();
theLog.printInfo((new java.util.Date().getTime() - startTime) + "ms.");
public int executeUpdate(Statement stmt, String sql)
throws StorageObjectException, SQLException
{
+ int rs;
long startTime = (new java.util.Date()).getTime();
- //theLog.printDebugInfo("trying: "+ sql);
- int rs = stmt.executeUpdate(sql);
- theLog.printInfo((new java.util.Date().getTime() - startTime) + "ms. for: " + sql);
+ try
+ {
+ rs = stmt.executeUpdate(sql);
+ theLog.printInfo((new java.util.Date().getTime() - startTime) + "ms. for: " + sql);
+ }
+ catch (SQLException e)
+ {
+ theLog.printDebugInfo("Failed: " + (new java.util.Date().getTime() - startTime) + "ms. for: "
+ + sql);
+ throw e;
+ }
return rs;
}