Oracle DefaultConnection doesn't work

From: <govindsri_at_my-deja.com>
Date: Wed, 07 Feb 2001 05:20:48 GMT
Message-ID: <95qlvb$kns$1_at_nnrp1.deja.com>


Hi folks
I am using Oracle 8.1.6 Personal Edition on Windows 2000.
I can't connect to the database using the server side jdbc driver. Following is a simple program.



import java.io.*;
import oracle.jdbc.driver.*;
class JdbcCheckup
{

   public static void main (String args []) throws SQLException, IOException

   {

      // Load the Oracle JDBC driver
      DriverManager.registerDriver(new

oracle.jdbc.driver.OracleDriver());
      Connection conn =
           new oracle.jdbc.driver.OracleDriver
().defaultConnection ();

// 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.");

   }
}



When I run it I get the following error... Exception in thread "main" java.sql.SQLException: No suitable driver

        at java.sql.DriverManager.getConnection (DriverManager.java:477)

        at java.sql.DriverManager.getConnection (DriverManager.java:159)

        at
oracle.jdbc.driver.OracleDriver.defaultConnection (OracleDriver.java:2
65)

        at JdbcCheckup.main(JdbcCheckup.java, Compiled Code)

All my PATH and CLASSPATH variables are pointing to the correct places.
I wonder why JServer/JVM is not giving me the connection.

Thanks a bunch.

Govind

Sent via Deja.com
http://www.deja.com/ Received on Wed Feb 07 2001 - 06:20:48 CET

Original text of this message