• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Servlets

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
reply
    Bookmark Topic Watch Topic
  • New Topic