Leaderboard1

Leaderboard2

Thursday, December 13, 2012

Connection timeout for DriverManager getConnection


You can set the Timeout on the Drivermanager like this:
 DriverManger.setLoginTimeout(10);
 Connection c = DriverManger.getConnection(url, username, password);
OR
String qqq = "jdbc:mysql://localhost/Test?connectTimeout=TIME_IN_MILLIS";
conn = DriverManager.getConnection(qqq, db_user, db_pass);

No comments:

Post a Comment