1
(click on this box to dismiss)
How to make JDBC driver fail faster if server is down?
When trying to connect a server which is down, CUBRID hangs for a long time (at least several minutes) before finally reporting that the host cannot be reached. This is quite annoying when testing. Is there a way to make it respond faster? Setting a timeout? For example a connect property?
The code I used:
Class<Driver> driverClass = BeanUtil.forName(driverClassName);
Driver driver = driverClass.newInstance();
java.util.Properties info = new java.util.Properties();
info.put("user", "xyz");
info.put("password", "xyz");
Connection connection = driver.connect(url, info);Regards,
Volker
1
Answer
0
Use connectTimeout parameter in your connection string. Defined in seconds.
asked last year
viewed 414 times