This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Servlets and the fly likes Servlets 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 » Java » Servlets
Reply Bookmark "Servlets" Watch "Servlets" New topic
Author

Servlets

ml behra
Greenhorn

Joined: Dec 20, 2000
Posts: 8
Hello guys!!!
I have a basic doubt.
DriverManager is a class then why is not instantiated as other classes.
For example we usually give as
Connection con=DriverManager.getConnection("jdbc.odbc.dsn","username","password");
Why don't we give as
DriverManager dm=new DriverManager(...)
waiting for reply
Thanks in advance.
Milind Mahajan
Ranch Hand

Joined: Oct 23, 2000
Posts: 77
Hi,
getConnection() method is a static method in DriverManager class. So, you don't need to instantiate it, to call the method.
There are no visible constructors in DriverManager class. So, you cannot create an instance of it. I guess it is similar to Math class.
Hope this helps.
Milind
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlets
 
Similar Threads
DriverManager lookup
Class.forName
Why Loading of Driver is required in JDBC
jdbc
Connection