Package net.sourceforge.squirrel_sql.fw.sql

Examples of net.sourceforge.squirrel_sql.fw.sql.SQLConnectionState


   /**
    * Reconnect to the database.
    */
   public void reconnect()
   {
      SQLConnectionState connState = new SQLConnectionState();
      if (_conn != null)
      {
         try
         {
            connState.saveState(_conn, getProperties(), _msgHandler);
         }
         catch (SQLException ex)
         {
            s_log.error("Unexpected SQLException", ex);
         }
      }
      OpenConnectionCommand cmd = new OpenConnectionCommand(_app, _alias,
                                 _user, _password, connState.getConnectionProperties());
      try
      {
         closeSQLConnection();
         _app.getSessionManager().fireConnectionClosedForReconnect(this);
      }
      catch (SQLException ex)
      {
         final String msg = s_stringMgr.getString("Session.error.connclose");
         s_log.error(msg, ex);
         _msgHandler.showErrorMessage(msg);
         _msgHandler.showErrorMessage(ex, this.getExceptionFormatter());
      }
      try
      {
         cmd.execute();
         _conn = cmd.getSQLConnection();
         if (connState != null)
         {
            connState.restoreState(_conn, _msgHandler);
            getProperties().setAutoCommit(connState.getAutoCommit());
         }
         final String msg = s_stringMgr.getString("Session.reconn", _alias.getName());
         _msgHandler.showMessage(msg);
         _app.getSessionManager().fireReconnected(this);
         startKeepAliveTaskIfNecessary();
View Full Code Here

TOP

Related Classes of net.sourceforge.squirrel_sql.fw.sql.SQLConnectionState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.