Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Oracle thin client installation and use
I am trying to install and use Oracle's thin client on my NT machine that
hosts the JavaWebServer1.1.3. I found the install instructions are either
wrong or very vague. However, I was able to perform the install. I
downloaded the classes12.zip file and unzipped it to create a series of
directories, which I then moved to JavaWebserver1.1.3/classes. I then
compiled the JdbcCheckup class (using javac -classpath
d:\JavaWebServer1.1.3\servlets;d:\jsdk2.0\lib\jsdk.jar;d:\JavaWebServer1.1.3
\classes JdbcCheckup.java ) successfully. However when I type: java
JdbcCheckup, I get the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: d:\JavaWebServer:
oracle/jdbc/driver/OracleDriver at JdbcCheckup.main(Compiled Code)
Note: The JdbcCheckup class is a class that Oracle provides that performs a simple query to check the database connection. The source code is:
/*
// You need to import the java.sql package to use JDBC import java.sql.*;
// We import java.io to be able to read from the command line import java.io.*;
class JdbcCheckup
{
public static void main (String args [])
throws SQLException, IOException
{
// Load the Oracle JDBC driver
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
// Prompt the user for connect information System.out.println ("Please enter information to test connection to the database");
String user;
String password;
String database;
user = readEntry ("user: ");
int slash_index = user.indexOf ('/');
if (slash_index != -1)
{
password = user.substring (slash_index + 1); user = user.substring (0, slash_index);}
System.out.print ("Connecting to the database..."); System.out.flush ();
System.out.println ("Connecting..."); Connection conn =
DriverManager.getConnection ("jdbc:oracle:thin:@" + database, user, password);
System.out.println ("connected.");
// Create a statement
Statement stmt = conn.createStatement ();
// Do the SQL "Hello World" thing
ResultSet rset = stmt.executeQuery ("select 'Hello World' from dual");
while (rset.next ())
System.out.println (rset.getString (1));
System.out.println ("Your JDBC installation is correct.");
// close the resultSet
rset.close();
// Close the statement
stmt.close();
// Close the connection
conn.close();
}
// Utility function to read a line from standard input
static String readEntry (String prompt)
{
try
{
StringBuffer buffer = new StringBuffer (); System.out.print (prompt); System.out.flush (); int c = System.in.read (); while (c != '\n' && c != -1) { buffer.append ((char)c); c = System.in.read (); } return buffer.toString ().trim ();}
Any help would be greatly appreciated!!
Note: I am using JDK1.2 (although I am not using any the features specific to 1.2 because the JavaWebServer doesn't support 1.2). Note also that I already have the Servlet application working with the ODBC-JDBC bridge. I am just trying to replace the use of that bridge with Oracle's Thin JDBC Client.
Thanks
Lisa
Received on Wed Jun 30 1999 - 11:52:57 CDT