473,405 Members | 2,279 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

error connecting to oracle

hi,

i'm getting the following error when i try to run the code below to
connect to an oracle db:

java.lang.ClassnotfoundException:oracle.jdbc.drive r.OracleDriver
java.sql.SQLException No suitable driver.

i'm using jdk1.4 installed on a Windows NT 2000 machine. I don't have
any oracle client installed on my machine. I'm basically connected to
our office network. The programs compiles but when I try to run it i'm
getting the error above. I'm fairly new to java & JDBC. I'm not the
Oracle administrator as well.
i've browsed the group fairly well but didn't get the answer i needed.
i also read about the classes111.zip but, i don't think it's
applicable in my case since I don't have oracle on my PC. Any help
would be appreciated. Thanks.

import java.sql.*;
import java.util.*;
import java.awt.*;

public class RPASelect {
public static void main(String args[]) {
String url = "jdbc:oracle:thin:@nnnn:nnnn:nnnn";
Connection con;
String queryString;
queryString = "select * from RPA.RPA_RESOURCE where
CUNYRPA.RPA_RESOURCE.COLCD = '**'";

Statement stmt;
ResultSet rs;

try {
DriverManager.registerDriver (new
oracle.jdbc.driver.OracleDriver());
//Class.forName("oracle.jdbc.driver.OracleDriver");
System.out.println("JDBC driver loaded");
}
catch(java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
}

try {
con = DriverManager.getConnection(url, "myID", "myPass");
stmt = con.createStatement();
rs = stmt.executeQuery(queryString);
while (rs.next()) {
System.out.println (rset.getString (1));
// String s = rs.getString("COF_NAME");
// float n = rs.getFloat("PRICE");
// System.out.println(s + " " + n);
stmt.close();
con.close();
}
catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
}
}
}
Jul 17 '05 #1
1 3117
You need the Oracle 9i Thin JDBC Driver. This is usually packaged
in a JAR file, and can most likely be found on oracle.com

-c

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Gabo | last post by:
Hello, I have a VB front end program that connects to an Oracle backend db. Nothing has changed on either end; however, when I try to connect to the db via VB program I receive a requires OLE DB...
0
by: Kong Li | last post by:
Follow up to this thread, the latest Oracle 9i release 2 patchset (9.2.0.5) fixed the handle count leak problem. The problem is in Oracle client component. Thanks. Kong ----- From: Kong...
2
by: python_eager | last post by:
Hi i am connecting my database oracle 9i. While connecting i am getting the following error connection = cx_Oracle.connect("myusername", "mypassword", "python") RuntimeError: Unable to acquire...
2
by: rcc.gamer | last post by:
Hello All, I am trying to connect a GridView to an Oracle table using the standard SqlDataSource. The process is fairly simple and there are detailed instructions from Microsoft ......
4
by: alegria4ever | last post by:
I have an Access 2000 database that links several tables from Oracle 9. For some reason or another, one of our user repeatedly gets the following error when accessing queries within this database:...
3
by: hakiran | last post by:
Hello all, I have been using Perl DBI the last 6months or so. I use it extensively with MySQL. But recently i tried to access Oracle DB with it and was having trouble. Any help would be...
4
by: musai | last post by:
I have created vb oracle application I installed oracle client in three machine. All machine was reconfigured after oracle installed I could see table and record set through sql plus sheet in...
2
by: devas | last post by:
Hai, Issue: I am using OEM 10g grid control. I want to establish the connection from oracle to sql server=>I can’t able to connect it. Please help me I have created the system dsn below steps....
1
by: 2desperate2usedesperate | last post by:
ERROR: You do not have SELECT privileges on sys.V_$PARAMETER view. This process cannot proceed. Hello, I am using ORACLE 10g Standard Edition and I am trying to configure the Oracle Designer for...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.