aspose file tools
The moose likes JDBC and the fly likes Registering driver with DriverManager Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Registering driver with DriverManager" Watch "Registering driver with DriverManager" New topic
Author

Registering driver with DriverManager

MaheshS Kumbhar
Ranch Hand

Joined: Sep 24, 2009
Posts: 188
Driver classes register themselves with DriverManager using static section at the time of loading driver class. My question is who loads the driver class so as to register with DriverManager?


I am slow but sure
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2896
    
    1

MaheshS Kumbhar wrote:My question is who loads the driver class so as to register with DriverManager?

I think, we load the Driver class. In any "Hello World" JDBC program, you can find the first line like


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2343

True for stand alone Java programs. If you are using containers to run your application (say: TomCat, Glassfish, what thave you), they load the drivers for all registered JDBC Connections.



OCUP UML fundamental
ITIL foundation
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Registering driver with DriverManager
 
Similar Threads
diff b/w class.forName() & DriverManager.registerDriver
jdbc
loading JDBC driver twice
reg class.forName()
jdbc with microsoft SQl Server 2008