Demos and Usage of java.sql.DriverManager.setLoginTimeout(int seconds)


   1:     try {
   2:       DriverManager
   3:         .println("User Message: No LogWriter. This won't be seen");
   4:         ...
   5:       PrintWriter log = new PrintWriter(System.out, true);
   6:       DriverManager.setLogWriter(log);
   7:         ...
   8:       DriverManager.println("User Message: LogWriter set");
   9: 
  10:         ...
  11:       Class.forName("COM.cloudscape.core.JDBCDriver");
  12:       DriverManager.setLoginTimeout(60);

View Full Code Here
   1:   public int getLoginTimeout()throws SQLException{
   2:     return DriverManager.getLoginTimeout();
   3:   } 
   4:         ...
   5:   public PrintWriter getLogWriter()throws SQLException{
   6:     return DriverManager.getLogWriter();
   7:   } 
   8:         ...
   9:   public void setLoginTimeout(int seconds)throws SQLException{
  10:     DriverManager.setLoginTimeout(seconds);
  11:   } 
  12:         ...
  13:   public void setLogWriter(PrintWriter out)throws SQLException{
  14:     DriverManager.setLogWriter(out);

View Full Code Here
   1: import java.sql.Connection;
   2: import java.sql.DriverManager;
   3: import java.sql.SQLException;
   4:         ...
   5:         return user == null 
   6:             ? DriverManager.getConnection(url) 
   7:         ...
   8:             : DriverManager.getConnection(url, user, password);
   9:     }
  10:         ...
  11:     public void setLoginTimeout(int timeout) throws SQLException {
  12:         DriverManager.setLoginTimeout(timeout);

View Full Code Here
   1:     String url = "jdbc:oracle:" + getSubname();
   2:     return DriverManager.getConnection(url, userid, password);
   3:   }
   4:         ...
   5:   public int getLoginTimeout() throws SQLException {
   6:     return DriverManager.getLoginTimeout();
   7:   }
   8:         ...
   9:   public PrintWriter getLogWriter() throws SQLException {
  10:     return DriverManager.getLogWriter();
  11:   }
  12:         ...
  13:   public void setLoginTimeout(int timeout) throws SQLException {
  14:     DriverManager.setLoginTimeout(timeout);

View Full Code Here
   1:         props.setProperty("password", passWord);
   2:         Connection c = DriverManager.getConnection(dbURL, props);
   3: 
   4:         ...
   5:     public void setLoginTimeout(int seconds) {
   6:         DriverManager.setLoginTimeout(seconds);
   7:     }
   8:         ...
   9:     public int getLoginTimeout() {
  10:         return DriverManager.getLoginTimeout();
  11:     }

View Full Code Here
   1: import java.sql.Connection;
   2: import java.sql.DriverManager;
   3: import java.sql.SQLException;
   4:         ...
   5:    {
   6:       return DriverManager.getConnection(url);
   7:    }
   8:         ...
   9:    {
  10:       return DriverManager.getConnection(url+";"+params);
  11:    }
  12:         ...
  13:    {
  14:       DriverManager.setLoginTimeout(timeout);

View Full Code Here
   1:         if (loginTimeout>=0) {
   2:             oldLoginTimeout = DriverManager.getLoginTimeout();
   3:         ...
   4:             DriverManager.setLoginTimeout(loginTimeout);
   5:         }
   6:         ...
   7:         if (username != null && password != null) {
   8:             retval = DriverManager.getConnection(dburl,username,password);
   9:         }
  10:         ...
  11:         else {
  12:             retval = DriverManager.getConnection(dburl);

View Full Code Here
   1: import java.sql.SQLException;
   2: import java.sql.DriverManager;
   3: import javax.sql.DataSource;
   4:         ...
   5:     public Connection internalGetConnection(String userName, String password) throws SQLException {
   6:         return DriverManager.getConnection(this.url, userName, password);
   7:     }
   8:         ...
   9:     public PrintWriter getLogWriter() throws SQLException {
  10:         return DriverManager.getLogWriter();
  11:     }
  12:         ...
  13:     public void setLoginTimeout(int seconds) throws SQLException {
  14:         DriverManager.setLoginTimeout(seconds);

View Full Code Here
   1: import java.sql.Connection;
   2: import java.sql.DriverManager;
   3: import java.sql.SQLException;
   4:         ...
   5:             throws SQLException {
   6:         return DriverManager.getConnection(dbURL, username, password);
   7: 
   8:         ...
   9:     public PrintWriter getLogWriter() throws SQLException {
  10:         return DriverManager.getLogWriter();
  11:     }
  12:         ...
  13:     public void setLoginTimeout(int seconds) throws SQLException {
  14:         DriverManager.setLoginTimeout(seconds);

View Full Code Here
   1: import java.sql.SQLException;
   2: import java.sql.DriverManager;
   3: import java.io.PrintWriter;
   4:         ...
   5:       throws SQLException {
   6:     return DriverManager.getConnection(dbURL, username, password);
   7: 
   8:         ...
   9:   public PrintWriter getLogWriter() throws SQLException {
  10:     return DriverManager.getLogWriter();
  11:   }
  12:         ...
  13:   public void setLoginTimeout(int seconds) throws SQLException {
  14:     DriverManager.setLoginTimeout(seconds);

View Full Code Here
   1: import java.sql.Driver;
   2: import java.sql.DriverManager;
   3: import java.sql.SQLException;
   4:         ...
   5:     public PrintWriter getLogWriter() throws SQLException
   6:     { return DriverManager.getLogWriter(); }
   7: 
   8:         ...
   9:     public void setLogWriter(PrintWriter out) throws SQLException
  10:     { DriverManager.setLogWriter( out ); }
  11: 
  12:         ...
  13:     public void setLoginTimeout(int seconds) throws SQLException
  14:     { DriverManager.setLoginTimeout( seconds ); }

View Full Code Here
   1: import java.sql.Driver;
   2: import java.sql.DriverManager;
   3: import java.sql.SQLException;
   4:         ...
   5:     public PrintWriter getLogWriter() throws SQLException
   6:     { return DriverManager.getLogWriter(); }
   7: 
   8:         ...
   9:     public void setLogWriter(PrintWriter out) throws SQLException
  10:     { DriverManager.setLogWriter( out ); }
  11: 
  12:         ...
  13:     public void setLoginTimeout(int seconds) throws SQLException
  14:     { DriverManager.setLoginTimeout( seconds ); }

View Full Code Here
   1:             s_driver = new org.postgresql.Driver();
   2:             DriverManager.registerDriver (s_driver);
   3:         ...
   4:             DriverManager.setLoginTimeout(Database.CONNECTION_TIMEOUT);
   5:         }
   6:         ...
   7:         getDriver();
   8:         return DriverManager.getConnection (getConnectionURL (connection), 
   9:             connection.getDbUid(), connection.getDbPwd());
  10:         ...
  11:         getDriver();
  12:         return DriverManager.getConnection (dbUrl, dbUid, dbPwd);

View Full Code Here
   1:                 s_driver = new com.sybase.jdbc3.jdbc.SybDriver();
   2:             DriverManager.registerDriver (s_driver);
   3:         ...
   4:             DriverManager.setLoginTimeout(Database.CONNECTION_TIMEOUT);
   5:         }
   6:         ...
   7:         getDriver();
   8:         return DriverManager.getConnection (getConnectionURL (connection), 
   9:             connection.getDbUid(), connection.getDbPwd());
  10:         ...
  11:         getDriver();
  12:         return DriverManager.getConnection (dbUrl, dbUid, dbPwd);

View Full Code Here
   1: import javax.resource.spi.security.PasswordCredential;
   2: import java.sql.DriverManager;
   3: import com.sun.gjc.spi.ManagedConnectionFactory;
   4:         ...
   5:             
   6:             dsConn = DriverManager.getConnection(spec.getDetail(DataSourceSpec.URL), driverProps);
   7:             
   8:         ...
   9:             timeOut = Integer.valueOf(loginTimeOut).intValue();
  10:             DriverManager.setLoginTimeout(timeOut);
  11:             spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
  12:         ...
  13:             timeOut = Integer.valueOf(loginTimeOut).intValue();
  14:             DriverManager.setLoginTimeout(timeOut);

View Full Code Here