Two Laptop Bag
The moose likes JDBC and Relational Databases and the fly likes Connecting to Oracle 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 "Connecting to Oracle" Watch "Connecting to Oracle" New topic

Connecting to Oracle

Gale Greaser

Joined: Aug 05, 2002
Posts: 17
Hi -
I'm having trouble connecting to an Oracle database.
This is the code I try to connect with:
System.out.println("got driver.");

(dies here) --> conn = DriverManager.getConnection("url", "user", "pass");
System.out.println("got Connection");
This is the error message I get:
java.sql.SQLException: No more data to read from socket
void oracle.jdbc.dbaccess.DBError.check_error(short)
short oracle.jdbc.ttc7.TTCInBuffer.getByte()
byte oracle.jdbc.ttc7.TTIMsg.unmarshalSB1()
void oracle.jdbc.ttc7.O3log.receive2nd()
oracle.jdbc.dbaccess.DBConversion oracle.jdbc.ttc7.TTC7Protocol.logon(java.lang.String, java.lang.String, java.lang.String, java.util.Properties)
oracle.jdbc.driver.OracleConnection(oracle.jdbc.dbaccess.DBAccess, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Properties)
java.sql.Connection oracle.jdbc.driver.OracleDriver.connect(java.lang.String, java.util.Properties)
java.sql.Connection java.sql.DriverManager.getConnection(java.lang.String, java.util.Properties, java.lang.ClassLoader)
java.sql.Connection java.sql.DriverManager.getConnection(java.lang.String, java.lang.String, java.lang.String)

Any suggestions?
Thanks in Advance!
Dean Reedy
Ranch Hand

Joined: Sep 10, 2001
Posts: 89
I do something like this:

Note: You will need to fill in the UserName, Password, <Host>,<Port>,<Instances>
Hope this helps.
Gale Greaser

Joined: Aug 05, 2002
Posts: 17
Thanks for the suggestion, but I received the same error when I tried it.
Could it be something with the Oracle Driver JAR file I'm using?
- Gale
Gale Greaser

Joined: Aug 05, 2002
Posts: 17
Yep - my suspicions were correct.
I downloaded a new Oracle 9i driver from:
- And what d'ya know, it worked!
Must have had the wrong driver version.
Thanks for you help though!
I agree. Here's the link:
subject: Connecting to Oracle
It's not a secret anymore!