Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JDBC -Java Configuration

Status
Not open for further replies.

GabeC

Programmer
Apr 17, 2001
245
US
I am new to Java development and am having trouble with database access.

Actually, the code works on my development machine where I have installed the development kit but it does not work on the staging machince where I have only installed the Java Runtime Environment.

This is my code:
Code:
import java.sql.*;
…
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver" );


This is the error I am receiving.
java.lang.ClassNotFoundException: sun/jdbc/odbc/JdbcOdbcDriver


My first thought is that the Java environment is not setup correctly and I have found web sites that verify this. What I can not find is how to correct the problem.

Can anyone tell me what I need to do on my staging computer to get this working?

Thank you for your help.

Gabe
 
Hi,
A ClassNotFoundException occurs only when u dont have the class which u are asking for..
When u do a Class.forName(*), u are trying to register that driver class as the one that u will be using to access the database.. but i think that class is not present in ur staging computer environment. All u need to do is to copy that file with the same package heirarchy into ur staging computer.

Hope this helps
Reddy316
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top