there are 2 methods to load jdbc drivers. class.forname() and system.getproperties(). when exactly these are used in programming .
posted 17 years ago
Hi, A Driver class should be implemented with a static section known as static initializer, that automatically does 2 things - (1) create an instance of itself and (2) register that instance by calling the method DriverManager.registerDriver(). When driver class includes this static section , the user can simply invoke the method Class.forName() supplying the name of the class, to load and register driver. For Example - Following code loads and registers the Driver class. Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); You can obtain properties of the driver using DatabaseMetaData object. System.getProperties() would get you the properties of the underlying system. Regards, Milind