Re: Oracle Problem

Veerendra Jote <[email protected]>
Newsgroups gmane.comp.java.sun.servlet
Message-ID <[email protected]>
Hi Souvik,
I guess ur classpath shuold include, classes12.jar/zip and not
classes111.jar/zip.
check up and then try.
also try to copy classes12.jar/zip to ur default java install's lib
directory.

Regards
Veeren
  -----Original Message-----
  From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[email protected]]On Behalf Of Souvik
Basak
  Sent: Tuesday, June 17, 2003 12:10 PM
  To: [email protected]
  Subject: Oracle Problem


  Hi,
     I have installed Oracle 9i in my machine. I'm using WindowsNT with SP6.
I have put classes111.zip in CLASSPATH variable. The folowing code
    import java.sql.*;

  public class TestSQL

      public static void main (String []

          try

              Class.forName("oracle.jdbc.driver.OracleDriver");
               System.out.println("Driver loaded");
              Connection con =
DriverManager.getConnection("jdbc:oracle:thin:127.0.0.1@1521:sid","username"
,"password");
              System.out.println("Connection Created");
              Statement stmt = con.createStatement();
              System.out.println("System created");
              ResultSet rs = stmt.executeQuery("Select * from tab;");
              System.out.println("Query Executed");

le(rs.next()){
                       System.out.println(rs.getString("TNAME"));
              }
              stmt.close();
              con.close();
          }catch (Exception ex){
                ex.printStackTrace();
           }
      }
  }

  gives
  Driver loaded
  java.sql.SQLException: No suitable driver
          at java.sql.DriverManager.getConnection(Unknown Source)
          at java.sql.DriverManager.getConnection(Unknown Source)
          at TestSQL.main(TestSQL.java:8)

  please help.
  -- Souvik Basak
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.