This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
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 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 and not
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 likely) or 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:
subject: help reuired in jdbc connection
It's not a secret anymore!