Home » Developer & Programmer » JDeveloper, Java & XML » query about jdbc connectivity to oracle8i
query about jdbc connectivity to oracle8i [message #366671] Sat, 02 September 2000 04:29 Go to next message
subhasish
Messages: 33
Registered: May 2000
Member
the following code for jdbc connectivity through thin driver works fine when database is oracle7.3 or 8.0, but it does not work with oracle8i( version 8.1.5.0). I have even copied classes12_01.zip file in /jdk1.2/lib. Please help me . Thanks in advance.
following error is reported:::

Exception in thread "main" java.sql.SQLException: Io exception: The Network Adap
ter could not establish the connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:156)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:210)

at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va:251)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:224)
at java.sql.DriverManager.getConnection(Compiled Code)
at java.sql.DriverManager.getConnection(DriverManager.java:137)
at dbAccess.main(Compiled Code)

the code is

import java.sql.*;
import java.math.*;
class dbAccess {
public static void main (String args [[]]) throws SQLException
{
DriverManager.registerDriver (new

oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection
("jdbc:oracle:thin:@172.31.61.2:1526:test", "tech",

"tech");
// @machineName:port:SID, userid,

password
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery("select BANNER from

SYS.V_$VERSION");
while (rset.next())
System.out.println (rset.getString(1)); // Print col 1
stmt.close();
}
}
Re: query about jdbc connectivity to oracle8i [message #366687 is a reply to message #366671] Sat, 30 September 2000 13:57 Go to previous message
Radhesh Mohandas
Messages: 20
Registered: August 2000
Junior Member
I had a similar problem. U have to remove the old
classes from CLASSPATH and it should work
Previous Topic: SQLJ
Next Topic: About Drivers
Goto Forum:
  


Current Time: Fri Jul 30 00:13:10 CDT 2021