Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

(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);



link comment (0)
asked 3 years ago
75 Answers

Use connectTimeout parameter in your connection string. Defined in seconds.

link comment (0)
answered 3 years ago

You are either using a very old browser or a browser that is not supported.
In order to browse you need to have one of the following browsers:

Internet Explorer: Mozilla Firefox: Google Chrome: