Hi! All, I use JDBC to connect a servlet to ORACLE, but there is always
an
error message while connecting -- "java.lang.ClassNotFoundException:
oracle/jdbc/driver/OracleDriver [oracle.jdbc.driver.OracleDriver]". But
I have installed oracle.jdbc.driver.OracleDriver (CLASSES111.zip) on the
machine on which servlet is running.

below is my code:

        final String URL="jdbc:oracle:thin@apollo:1521:USERS";
        //apollo is the server where Oracle is installed.
        //1521 is the port number. Do I need to specify it? How?
        //USERS is sid

        final String dbUserID = "steve";
        final String dbPassword = "smart";

        // set up connection property
        Prop = new Properties();
        Prop.put("user", dbUserID);
        Prop.put("password", dbPassword);

        try{
                DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

                con = DriverManager.getConnection(URL, Prop);

        } catch( Exception e ){
                throw (new DBException("Database Connection Failed. " +
e.toString()));
        }//this is where the error is from.


Can anyone help?
Thanks a lot!

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to