Hey Jeff,
Try this small test program:
-------
import java.sql.*;
import jdbc.idbDriver;
public class testInstantDB{
static Connection con;
public testInstantDB() throws Exception{
idbDriver idb1=new idbDriver();
Class.forName ("jdbc.idbDriver"); // InstantDB
String dsn = "jdbc:idb:sample.prp"; // InstantDB
con = DriverManager.getConnection(dsn);
con.setAutoCommit(false);
Statement stmt;
ResultSet rs;
stmt = con.createStatement();
stmt.execute("drop table datetest");
stmt.execute("create table datetest (data0 integer,data1 integer, data2
integer)");
stmt.execute("insert into datetest values (0,1,2)");
rs = stmt.executeQuery("select * from datetest");
while (rs.next()){
System.out.println("data0:"+rs.getString(1)+" data1:"+rs.getString(2)+"
data2:"+rs.getString(3));
System.out.println(" data0I:"+rs.getInt(1)+" data1I:"+rs.getInt(2)+"
data2I:"+rs.getInt(3));
}
rs.close();
stmt.close();
con.commit();
con.close();
}
public static void main(String[] args){
try{
testInstantDB test= new testInstantDB();
}
catch (Exception e){
e.printStackTrace();
}
}
}
------------
Greetings
Martin
"Jeff Douglas" <jeff.douglas@backsoft.com> on 31-01-2000 04:17:38
To: instantdb@smartcard.co.uk
cc:
Subject: Unable to find class jdbc.idbDriver
I'm new to Java in general. I downloaded InstantDB and have it working
through the GUI interface (JDBCmain). The idb.jar is also in the CLASSPATH
environmental variable. However, I am unable to connect to is via a JSP
page.
Here is the code that I am using:
<%
Connection db = null;
Statement st = null;
String url = "jdbc:idb=sample.prp";
String username = "";
String password = "";
%>
<%
Class.forName("jdbc.idbDriver");
db = DriverManager.getConnection(url, username,password);
st = db.createStatement();
ResultSet rs = st.executeQuery("SELECT * FROM Users");
%>
The error is: "Unable to find class jdbc.idbDriver"
I tried using <%@ page import="jdbc.*" %> but received
a similar error message: "Package jdbc not found in
import."
How do specify and locate a specific driver? Does it
have to be in the CLASSPATH or something. I'm using the Java Web Server 2.0.
Thanx for the help.
Jeff Douglas
To unsubscribe from this list, please send an
email to 'majordomo@smartcard.co.uk' with the text
'unsubscribe instantdb' in the message body.
To unsubscribe from this list, please send an
email to 'majordomo@smartcard.co.uk' with the text
'unsubscribe instantdb' in the message body.
|