wood burning stoves 2.0*
The moose likes JDBC 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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Type 4 Java Pure Driver" Watch "Type 4 Java Pure Driver" New topic
Author

Type 4 Java Pure Driver

Anirban Das
Ranch Hand

Joined: Nov 22, 2003
Posts: 63
Hi
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.
Regards
Bamby
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.


Dave
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Type 4 Java Pure Driver
 
Similar Threads
JDBC TYPE 3 driver -more explanation?
DIFFERENT TYPES OF Jdbc Driver
What is the JDBC type that we are using?
Connection with SQL Server
Advantages of type3 jdbc driver when compare to typd4 jdbc driver