Thread View: comp.databases.oracle.tools
1 messages
1 total messages
Started by Sasu Mattila
Thu, 23 Jul 1998 00:00
Oracle Thin JDBC driver problem
Author: Sasu Mattila
Date: Thu, 23 Jul 1998 00:00
Date: Thu, 23 Jul 1998 00:00
52 lines
2533 bytes
2533 bytes
Any suggestions? Oracle Thin JDBC does not work in some environments.
Three computers:
NT 4 and JDK 1.1.2 Borland (OK)
NT 4 and JDK 1.1.3 Sun (FAIL)
Sun and JDK 1.1.5 Sun (FAIL)
On the machines with the Sun JDK the Oracle supplied Thin JDBC sample
program does not work, even though the classes111.zip is in the
classpath.
On the Borland JDK machine the same sample program works OK.
To add a twist to this - a JBuilder2 application using
Database/QueryDataSet works even on the Sun JDK machines. But not the
Oracle supplied sample program! What does JBuilder2 do differently to
get those Thin drivers working?
The stack trace looks like this:
java.lang.NoClassDefFoundError: oracle/sqlnet/SQLnetPacket
at oracle.sqlnet.SQLnet.Connect(SQLnet.java:200)
at oracle.sqlnet.SQLnet.Connect(SQLnet.java:146)
at oracle.sqlnet.SQLnet.Connect(SQLnet.java:120)
at oracle.jdbc.ttc7.TTC7Protocol.connect(TTC7Protocol.java:983)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:158)
at
oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:93)
at
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:146)
at java.sql.DriverManager.getConnection(DriverManager.java:91)
...
The program is here:
import java.sql.*;
class JdbcTest {
public static void main (String args []) throws SQLException {
// Load Oracle driver
DriverManager.registerDriver (new
oracle.jdbc.driver.OracleDriver());
// Connect to the local database
Connection conn = DriverManager.getConnection
("jdbc:oracle:thin:@db.my:1521:EETU", "user", "password");
// Query the employee names
Statement stmt = conn.createStatement ();
ResultSet rset = stmt.executeQuery ("select * from user");
// Print the name out
while (rset.next ())
System.out.println (rset.getString (1));
}
}
Many thanks!
sasu
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads