• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Two ways to get Connection object.

 
Vishal Saxena
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
#1. DriverManager.getConnection(String url);
#2. Driver driver = DriverManager.getDriver(url);
driver.connect(url);
I want to know, the difference between them, which one to use under what requirement ?
 
indian greenhorn
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vishal Saxena:
#1. DriverManager.getConnection(String url);
#2. Driver driver = DriverManager.getDriver(url);
driver.connect(url);
I want to know, the difference between them, which one to use under what requirement ?


Hi Vishal,
Just go through the java documention and API for SQL it will give u a clear picture and difference of the statements u have given.
regards,
Krishna
 
Vishal Saxena
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey krishna,
Can you elaborate ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic