aspose file tools*
The moose likes JDBC and the fly likes having problem with jdbc connection for Personal Oracle8i on win98 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "having problem with jdbc connection for Personal Oracle8i on win98" Watch "having problem with jdbc connection for Personal Oracle8i on win98" New topic
Author

having problem with jdbc connection for Personal Oracle8i on win98

pradeep banavara
Greenhorn

Joined: Feb 11, 2002
Posts: 2
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

Joined: Jan 17, 2001
Posts: 71
Which driver are you using?, It'd help if you post the complete error trace.


Nitin S<br />Sun Certified Java Programmer for the Java 2 platform.<br />Tekmetrics Certified Java Programmer For the Java 2 Platform.
pradeep banavara
Greenhorn

Joined: Feb 11, 2002
Posts: 2
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:
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: having problem with jdbc connection for Personal Oracle8i on win98