File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Type 4 Java Pure Driver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Type 4 Java Pure Driver" Watch "Type 4 Java Pure Driver" New topic

Type 4 Java Pure Driver

Anirban Das
Ranch Hand

Joined: Nov 22, 2003
Posts: 63
I want to connect to my Microsoft SQL 7.0 database and Oracle9i database using Type 4 (Pure Java Driver).Could you please tell me what will be the JDBC URL for both the databases?
Also I want to know whether I have to install any other thing apart from the respective databases.
It will be very nice if you can post me the actual code for the conection.
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
Cool Bamby
Welcome to the Java Ranch, we hope you�ll enjoy visiting as a regular however, your name is not in keeping with our naming policy here at the ranch. Please change your display name to an appropriate name as shown in the policy.
Thanks again and we hope to see you around the ranch!!
For the JDBC URL question that is going to depend on the driver you are using for each database. The driver you installed should tell you what connection URL to use or what format it must be in.

Anurag Gupta
Ranch Hand

Joined: Dec 13, 2001
Posts: 40
1)Decide which Driver to be use :
You could use the following :
(a)For Oracle & SQL Server --> Merant SequeLink Server (Type 3) ; Data-Direct Connect for JDBC (Type 4)
(b)For Oracle : Oracle Thin Driver (Type 4)
2) Once DataBase and Driver is decided, u need to know which Class to use and what url to connect to.
(a) In Case you use Merant SequeLink Server :
Class : com.merant.sequelink.jdbc.SequeLinkDriver
URL : jdbc:sequelink://server:19996;user=userid;password=passwd;dataSourceName=SID
(b) In Case you use Oracle Thin Driver :
Class racle.jdbc.driver.OracleDriver
URL :jdbc racle:thin:userid/password@server:1521 racleSID
3) Once you have above info, you can connect to the DataBase, using std code.
String l_class = "oracle.jdbc.driver.OracleDriver";
String l_url = "jdbc racle:thin:userid/password@server:1521 racleSID";
Class.forName( l_class ) ;
Connection conn = DriverManager.getConnection( l_url ) ;

Anurag Gupta
I agree. Here's the link:
subject: Type 4 Java Pure Driver
jQuery in Action, 3rd edition