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