Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Other Java > Java Databases
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Java Databases Discussion specific to working with Java Databases. For other Java topics, please see related Java forums. For database discussions not specific to Java, please see the Database category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 6th, 2003, 10:01 PM
Authorized User
Join Date: Jul 2003
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default connecting to oracle


i'm fairly new to java. i'm trying to connect to an oracle database but it's giving me the following error:

C:\JSPTests>java RPASelect
ClassNotFoundException: oracle.jdbc.driver.OracleDriver
SQLException: No suitable driver

i have j2sdk1.4 installed on my Windows NT 2000. i don't have any oracle installed on my machine. i'm basically connected to our office network. i'm not the oracle admin. i also read about the classes111.zip but i don't know if it applies to me since i'm not running oracle on my local machine. i also trying running the same code connecting to MS Access (changing what i need to change) and i get results. however, when i try modify the program to connect to oracle. i get the message above. what am i doing wrong? thanks for any help. i'm also using "thin".

here's the code i'm using:

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

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

Statement stmt;
ResultSet rs;

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

try {
con = DriverManager.getConnection(url, "myID", "myPass");
stmt = con.createStatement();
rs = stmt.executeQuery(queryString);
while (rs.next())
catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());

I've read some people said I need to download classes111.zip or jbdc14.jar from www.oracle.com. Is this applicable to my setup which I describe above? If in fact I need it, where to I install the file on my PC? Which one to I really need (classes111.zip or jbdc14.jar)? I'm getting confused. Please advise. Thank you in advance.


  #2 (permalink)  
Old August 12th, 2003, 12:08 PM
Authorized User
Join Date: Jul 2003
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts

got this one to work. i downloaded jbdc14.jar and modified my classpath..

  #3 (permalink)  
Old September 20th, 2003, 05:17 PM
Registered User
Join Date: Sep 2003
Location: Abu Dhabi, Abu Dhabi, United Arab Emirates.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to yasir_lahham

I'm using classes11.zip and it's working perfectly, just download it, and modify your classpath in the system environment to include it (for example c:\classes.zip), or if you're doing a web-application put it in the "WEB-INF/lib" directory and thats all, notice that in some cases you might have to rename the file to classes.jar.

MHD Yasir Al-lahham

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting to oracle from PHP paragajoshi PHP Databases 2 November 16th, 2011 05:26 PM
Connecting to Oracle with PHP atcs2152 PHP Databases 0 December 16th, 2005 08:57 AM
Connecting to Oracle without Oracle Client mahaveerar VB Databases Basics 0 February 22nd, 2005 05:18 PM
Connecting to Oracle without Oracle Client mahaveerar Excel VBA 0 February 22nd, 2005 03:55 PM
Connecting an oracle database kelitu Oracle 0 September 4th, 2003 09:18 AM

All times are GMT -4. The time now is 08:17 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.