• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

having problem with jdbc connection for Personal Oracle8i on win98

 
pradeep banavara
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i have personal oracle 8i running on a win98 machine with jdk1.3 installed.
i am trying to connect to the oracle datatbase using jdbc.
I downloaded the classes12.zip from oracle and tried the sample code.
Even then there is problem with the program saying no driver found.
actually i have ocijdbc8.dll in my orawin95\bin directory.
please help me in this regard.
I have already gone through all the links in oracle and sun websites. I have also added the suitable classpaths.
please let me know how do i go fwd asap.
cheers!
 
Nitin Shivaram
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which driver are you using?, It'd help if you post the complete error trace.
 
pradeep banavara
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi here is the stack trace i am getting......
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:537)
at java.sql.DriverManager.getConnection(DriverManager.java:199)
at oracle.jdbc.driver.OracleDriver.defaultConnection(OracleDriver.java:382)
at JdbcCheckup.main(JdbcCheckup.java:25)
Exception in thread "main"

this is for the following piece of code......
/*
* This sample can be used to check the JDBC installation.
* Just run it and provide the connect information. It will select
* "Hello World" from the database.
*/
// You need to import the java.sql package to use JDBC
/*
* This sample can be used to check the JDBC installation.
* Just run it and provide the connect information. It will select
* "Hello World" from the database.
*/
// 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.OracleDriver());

Connection conn = new oracle.jdbc.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.");
}
}
this code is the sample file....taht i got.
i have set the class path correctly.
cheers!
:roll:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic