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 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" Watch "Type 4" New topic

Type 4

Rajarsi Ghosh

Joined: May 20, 2006
Posts: 15
Hi All

Where will i find a type 4 driver and how to use it. I have used type 1 driver till date. Can anybody let me know in details about how to use the type 4 driver also where i will get this driver.

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15033

JDBC driver types.

Type 1 is the JDBC-ODBC bridge driver.

What database are you using? You need a driver for your particular database. For most databases, type 4 drivers are available (for example the Oracle thin driver, for MySQL, etc.).

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Rajarsi Ghosh

Joined: May 20, 2006
Posts: 15
I am using Oracle 9i database.
naidu gulla

Joined: Jul 19, 2006
Posts: 14
type 4 is nothing but thin driver
ifyou use oracle
the same procedure difference use
u have to use the following driver
Connection con=DriverManager.getConnection("jdbcracle:thin:@localhost:1521rcl","scott","tiger");

ok any questions u can
Rajarsi Ghosh

Joined: May 20, 2006
Posts: 15

I am getting the following error:

java.sql.SQLException: Io exception: The Network Adapter could not establish the connection

I used the following piece of code:
Connection con= DriverManager.getConnection("jdbcracle:thin:@connectionstring:1521rcl","username","password");

where connectionstring is the connection string of the Oracle 9i database and username and password are Oracle userid and password.

Can anybody tell me where i am going wrong.

[ July 25, 2006: Message edited by: Rajarsi Ghosh ]
A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 980

Even i had faced the same problem..Dont remember exactly what i did...
but try to set the classpath.

I agree. Here's the link:
subject: Type 4
jQuery in Action, 3rd edition