Hi, friends:
I got some proble to install/use JDBC. I am looking for help.
The problems are:
1. I install JAVA (jdk116_v5), JDBC (8.0.5 thin), and ORACLE (8.0.5) on my
linux
   box (RH5.2 linux v2.0.35). The PATH and CLASSPATH are set up as following:
        PATH=$PATH:$HOME/bin:.
        PATH=$PATH:/usr/oracle/product/805/jdbc/lib/
        CLASSPATH=.:/usr/local/jdk116_v5/lib/classes.zip
        CLASSPATH=$CLASSPATH:.:/usr/oracle/product/805/jdbc/lib/classes111.zip

        Since I downloaded the JDBC driver for ORACLE from www.oracle.com. I
        download it as 8.1.5 thin driver (actually is classes111.zip). Is this
        driver is correct? and are the PATH and CLASSPATH correct?

2. I have a very simple java file to test JDBC driver (as following)
*************************************************************
        import java.sql.*;

        public class CreateCoffees {
         public static void main(String args[]) {
                String url = "jdbc:oracle:thin:@152.1.75.166:1521:orcl";
                //152.1.75.166 is my localhost's IP address
                Connection con;
                String createString;
                createString = "create table COFFEES " +
                            "(COF_NAME VARCHAR(32), " +
                            "SUP_ID INTEGER, " +
                            "PRICE FLOAT, " +
                            "SALES INTEGER, " +
                            "TOTAL INTEGER)";
                         Statement stmt;

                 try {
                 Class.forName("myDriver.ClassName");
                 } catch(java.lang.ClassNotFoundException e) {
                 System.err.print("ClassNotFoundException: ");
            System.err.println(e.getMessage());
                }

                        try {
                 con = DriverManager.getConnection(url, "system", "manager");
                 stmt = con.createStatement();
                 stmt.executeUpdate(createString);
                stmt.close();
                con.close();

        } catch(SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
                        }
                }
        }
*******************************************************************************

When I compile the file:
        javac CreateCoffees.java
It is OK. But when I run it, I always got the error messages:
****** error message *****
ClassNotFoundException: myDriver/ClassName
SQLException: driver not found: jdbc:oracle:thin:@152.1.75.166:1521:orcl
********************************

Can anybody can give me suggestion or solution(s)?
The other question is how can I make sure that the JDBC driver is working
proply? Any test progran can I make sure the JDBC driver is correct?

Thanks for your help!

Regards,


Chien-Lung Wu

-- 
Chien-lung Wu


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to