I am trying to connect to DB using the standard JDBC way
connection = DriverManager.getConnection(url, username, password);
Is there a maxi
You can use ExecutorService interface from Java. Below is a sample of what you need to do.
Future future = executor.submit(YOUR_METHOD); future.get(TIMEOUT_YOU_NEED, TimeUnit.SECONDS);