wood burning stoves 2.0
The moose likes JDBC and Relational Databases and the fly likes help reuired in jdbc connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "help reuired in jdbc connection" Watch "help reuired in jdbc connection" New topic

help reuired in jdbc connection

felix thomas
Ranch Hand

Joined: Jun 10, 2001
Posts: 89
i am using oracle 8.1.5 fo windows

but i am getting this error whil runing my code
Employee.java:21: package no suitable driver exists.
the code is given below
import java.sql.*;
class Test{
public static void main (String args []) throws SQLException {
// Load the Oracle JDBC driver DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); Connection conn = DriverManager.getConnection ("jdbc racle", "scott", "tiger"); System.out.println("connection"); conn.close(); } }

I have set the classpath also to the driver
but not the path.
could any one help me out.
Mahesh Mamani
Ranch Hand

Joined: Jun 25, 2001
Posts: 110
The code is ok...anyway here's a test code, which u may use, if needed...
Also I think the zip file should be classes111.zip and not classes112.zip.
Properties x = new Properties();
String url= "jdbc racle:thin:@";
Connection conn = DriverManager.getConnection(url, x);
Statement st=conn.createStatement();
ResultSet rs=st.executeQuery("select * from news");
}catch(Exception e){

Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

you are missing information in your getConnection URL. see this page for complete details. The skinny of it is that "jdbcracle" is only partially correct. The specs say you need to have "jdbcracle:thin:<host_name>:<port_number>:<database_name(SID)>" most of which you are missing
you will encounter this problem after your classpath problem. For the classpath problem, your drivers will be either classes12.zip(most likely) or classes111.zip. So you should change your classpath to reflect this.
[ April 29, 2002: Message edited by: Jamie Robertson ]
[ April 29, 2002: Message edited by: Jamie Robertson ]
I agree. Here's the link: http://aspose.com/file-tools
subject: help reuired in jdbc connection
It's not a secret anymore!