Пример #1
0
 /**
  * Execute a command if it is non-empty. If an exception occurs, wrap it in a streambase exception
  * that includes the command.
  *
  * @throws StreamBaseException If anything goes wrong.
  */
 private boolean execute(Statement statement, String command) throws StreamBaseException {
   if ("".equals(command)) return false;
   Msg.debug("sqlscript: " + command);
   try {
     statement.execute(command);
   } catch (SQLException e) {
     throw new StreamBaseException(
         Msg.format("Exception while executing {0}", Util.quote(command)), e);
   }
   return true;
 }
Пример #2
0
 public void forciblyReleaseConnection() {
   try {
     Connection con = dataSource.getConnection(dataSource.numTypecheckReconnectAttempts());
     if (con != null) {
       dataSource.actuallyReleaseConnection(con);
     }
   } catch (StreamBaseException e) {
     Msg.debug(e);
   }
 }