aspose file tools*
The moose likes JDBC and the fly likes Registering driver with DriverManager Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
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: 2902
    
    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: 2503
    
    8

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 and ITIL foundation
youtube channel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Registering driver with DriverManager