DriverManager
Hi Friends
What is DriverManager?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted Nov 29, 2012, 6:38 AM
DriverManager class
It's used for establishing JDBC connections and for managing JDBC drivers. JDBC 2.0 API has a new interface DataSource and the preferred means of connecting to a data source has now become by using a DataSource object.
DriverManager tries to load the driver classes mentioned in the 'jdbc.drivers' system property while the initialization. You can explicitly load JDBC drivers at any time by using the 'Class.forName("driver class");' syntax.
getConnection method of the DriverManager class tries to locate a suitable driver from amongst those loaded either during the initialization or by using Class.forName() explicitly. On successful invocation, this method returns a Connection object. You need to specify the database url having the subprotocol & subname, user id, password, etc. If any error occours during the database access then a SQLException is thrown.
http://geekexplains.blogspot.in/2008/05/role-of-drivermanager-class-and-driver.html
http://www.java-samples.com/showtutorial.php?tutorialid=632
http://docs.oracle.com/javase/1.4.2/docs/api/java/sql/DriverManager.html
VulpesPosted Nov 29, 2012, 6:25 AM