Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register


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

link comment (0)
asked 2 years ago
vbergmann
31
75 Answers
0

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

link comment (0)
answered 2 years ago
dba
558




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



Internet Explorer: Mozilla Firefox: Google Chrome: