Unable to get CreateCoffees to run on Centura sqlbase
Good morning,
Can someone help me get this to run?
When I run the CreateCoffees java tutorial I get the following:
C:\jdk1.3.1\bin>java CreateCoffees
ClassNotFoundException: centura.java.sqlbase.SqlbaseDriver
SQLException: No suitable driver
I have the SqlbaseDriver on my d:\Centura\java\sqlbase drectory.
My code is as follows:
import java.sql.*;
public class CreateCoffees {
public static void main(String args[]) {
String url = "jdbc:sqlbase://TECHF/PREQTST";
Connection con;
String createString;
createString = "create table COFFEES " +
"(COF_NAME VARCHAR(32), " +
"SUP_ID INTEGER, " +
"PRICE FLOAT, " +
"SALES INTEGER, " +
"TOTAL INTEGER)";
Statement stmt;
try {
Class.forName("centura.java.sqlbase.SqlbaseDriver");
} catch(java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
}
try {
con = DriverManager.getConnection(url, "login", "pass");
stmt = con.createStatement();
stmt.executeUpdate(createString);
stmt.close();
con.close();
} catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
}
}
}
Thanks in advance for your help.
Regards,
Scott Armand

