Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

NetBeans, jdbc/odbc, ClassNotFoundException

843854Dec 6 2003 — edited Dec 6 2003
Hi, I'm getting a "unreported exception java.lang.ClassNotFoundException;" error
when I try to use the JDBC/ODBC driver in the NetBeans IDE 3.5.1 (Java 1.4.2).
(Running on an MS WinXP box)

I've trolled the forums for a few and a lot of people talk
about jar files and classpath and stuff, which is a little over my head.

Is there a specific jar file I need to have on my machine for this to work?
Where would I get it?
Where would I put it?

Right now Java/NetBeans is living on my machine at:
C:\java\
With folders: j2sdk1.4.2\ and netbeans3.5.1\

Any help would be GREATLY appreciated.

Below is the entire code of the program I'm trying to run:
import java.sql.*;
import java.io.*;

public class DatabaseConn3 {
  public void selectData() {
      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  }
  public static void main(String[] args) {
    DatabaseConn3 SelStatment = new DatabaseConn3();
    SelStatment.selectData();
  }
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 3 2004
Added on Dec 6 2003
3 comments
437 views