File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Two ways to get Connection object. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Two ways to get Connection object." Watch "Two ways to get Connection object." New topic
Author

Two ways to get Connection object.

Vishal Saxena
Greenhorn

Joined: Apr 23, 2003
Posts: 26
#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 ?


Thx -V
indian greenhorn
Greenhorn

Joined: May 01, 2003
Posts: 16
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

Joined: Apr 23, 2003
Posts: 26
hey krishna,
Can you elaborate ?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Two ways to get Connection object.
 
Similar Threads
JDBC implementions
Loading file data into a DB2 table using java
WA #1.....word association
jdbc error
netbeans-odbc jar file