This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JDBC and the fly likes Type 4 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Type 4" Watch "Type 4" New topic
Author

Type 4

Rajarsi Ghosh
Greenhorn

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.

regards
Rajarsi
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14114
    
  16

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 7 API documentation
Scala Notes - My blog about Scala
Rajarsi Ghosh
Greenhorn

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

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
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbcracle:thin:@localhost:1521rcl","scott","tiger");


ok any questions u can
Rajarsi Ghosh
Greenhorn

Joined: May 20, 2006
Posts: 15
Hi

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:
============================================================
Class.forName("oracle.jdbc.driver.OracleDriver");
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.

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

Joined: Jul 04, 2004
Posts: 979
Hi,

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

Regards
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Type 4