Hello World 71 Driver getDriver(String URL) The method returns (Hsphere web hosting)
Hello World 71 Driver getDriver(String URL) The method returns a registered driver that will potentially be used to connect to a database with the provided URL. Enumeration getDrivers() The method returns all of the currently registered drivers. int getLoginTimeout() The method returns the maximum time in seconds that the current DriverManager will wait for a connection to a database. void setLoginTimeout(int secs) The method sets the maximum time in seconds that the current DriverManager will wait for a connection to the database. These methods can be characterized into three groups: driver management, timeout management, and connection management. Driver Management Methods Once a driver (or set of drivers) has been registered with a DriverManager, you usually don t have to do anything further with the driver. However, a few methods are available for obtaining and removing drivers from the DriverManager if you need to. A current list of registered drivers can be obtained using code like this: Enumeration e = DriverManager.getDrivers(); while (e.hasMoreElements()) { Driver d = (Driver)e.nextElement(); System.out.println(”Driver Major Version = ” + d.getMajorVersion()); } Once a reference to a driver has been obtained, the deRegisterDriver() method can be used to remove the driver. In almost all cases, you won t need to use any of this information unless you want to remove from the application all JDBC access to a particular database. Timeout Management Methods When connecting to a database whether local or remote to the Java application the application doesn t know if the database system itself is currently online. There can be situations where a database is down for maintenance or the machine has crashed. A Java application has the option of setting a timeout value for the maximum time that the DriverManager will wait as it attempts to create a connection. The default timeout is 30 seconds before the driver throws a java.net.ConnectException exception. For situations where the database is on a remote machine, the timeout might need to be extended. The following code shows an example of setting a timeout of 90 seconds: DriverManager.setLoginTimeout(90);
Note: If you are looking for good and quality webspace to host and run your java application check professional java hosting services