File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Help...Problem with Class.forName( Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of RabbitMQ in Depth this week in the Open Source forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Help...Problem with Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");  " Watch "Help...Problem with Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");  " New topic

Help...Problem with Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Travis Gibson
Ranch Hand

Joined: Oct 17, 2000
Posts: 100
I feel silly for evening asking this question but here it goes.
I keep getting the following message: cannot resolve symbol
symbol: method forName (java.lang.String)
location: class Class
* @(#)CreateCoffees.java1.2 99/04/23
import java.sql.*;
// Create the Coffee Table.
public class CreateCoffees {
public static void main(String args[]) {
String url = "jdbc dbc:CafeJava";
Connection con;
String createString;
createString = "create table COFFEES " +
"(COF_NAME varchar(32), " +
"SUP_ID int, " +
"PRICE float, " +
"SALES int, " +
"TOTAL int)";
Statement stmt;
try {
//Class.forName("C:\Program Files\JavaSoft\JRE\1.3\bin\Jdbc0dbc.dll");
} catch(java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
try {
con = DriverManager.getConnection(url,
"Admin", "duke1");
stmt = con.createStatement();
} catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());

Regards,<BR>Travis M. Gibson, SCJP<BR>Java Developer<BR><BR>
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
This is almost always a classpath issue. Check your classpath and make sure that it is set up correctly.

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
I agree. Here's the link:
subject: Help...Problem with Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");