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 types of drivers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "types of drivers" Watch "types of drivers" New topic
Author

types of drivers

venkat
Greenhorn

Joined: Jan 23, 2000
Posts: 10
please send the connection code for all 4 drivers.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Connection code is always the same regardless of Driver version, vendor and type, that's the point.

Please see the warning on your display name here, your account is about to be deleted.
ganesh narayana
Greenhorn

Joined: Sep 10, 2005
Posts: 7
Dear Friend,

only the driver and URL differes from one type to second type.

type1

driver : sun.jdbc.odbc.JdbcOdbcDriver
url : jdbc dbc:<<dsn name>>

type 2 for oracle

driver : oracle.jdbc.driver.OracleDriver
url : jdbc racle ci8:@

type 4 for oracle

driver : oracle.jdbc.driver.OracleDriver
url : jdbc racle:thin:@localhost:1521:<<oracle SID>>


then use Class.forName(driver name)
Connection con=DriverManager.getConnection(url,username,password)

for example :

Class.forName(oracle.jdbc.driver.OracleDriver)
Connection con=DriverManager.getConnection("jdbc racle:thin:@localhost:1521:<<oracle SID>>","scott","tiger");




to connect to the specific database.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: types of drivers
 
Similar Threads
OCI drivers
How can we get Driver Info?
Difference between Type II and Type IV driver
while connecting to database
Usage of Polymorphism feature in a project