Subject | NEWBEE jdbc connect question |
---|---|
Author | Richard Drent |
Post date | 2003-10-10T08:47:35Z |
Hi all
A slightly stupid question, but it may be so simple that I can't find a
proper example.
Can some body give me en example of how to execute this statement
select full_name from employee where salary < 50000")
with this jdbc driver
org.firebirdsql.jdbc.FBDriver
this is what I tried
Connection con;
String databaseURL =
"jdbc:firebirdsql:192.168.0.115/3050:/home/firebird/data/employee.fdb";
String user = "sysdba";
String password = "pass";
//String driverName = "org.firebirdsql.jdbc.FBDriver";
//Load driver
Class.forName("org.firebirdsql.jdbc.FBDriver");
//Attempt to connect to a driver.
con = DriverManager.getConnection(databaseURL, user, password);
//Create a Statement object
stmt = con.createStatement();
result = stmt.executeQuery ("select full_name from employee where salary <
50000");
and this is his error
org.apache.jasper.JasperException: Unable to compile class for
JSP/usr/java/jakarta-tomcat-3.2.3/work/192.10.10.20_8080/_0002fconnect_00033
_0002ejspconnect3_jsp_12.java:83: Undefined variable: stmt
stmt = con.createStatement();
^
/usr/java/jakarta-tomcat-3.2.3/work/192.10.10.20_8080/_0002fconnect_00033_00
02ejspconnect3_jsp_12.java:85: Undefined variable: result
result = stmt.executeQuery ("select
full_name from employee where salary < 50000");
^
/usr/java/jakarta-tomcat-3.2.3/work/192.10.10.20_8080/_0002fconnect_00033_00
02ejspconnect3_jsp_12.java:85: Undefined variable or class name: stmt
result = stmt.executeQuery ("select
full_name from employee where salary < 50000");
Thanks for your help
Richard Drent
A slightly stupid question, but it may be so simple that I can't find a
proper example.
Can some body give me en example of how to execute this statement
select full_name from employee where salary < 50000")
with this jdbc driver
org.firebirdsql.jdbc.FBDriver
this is what I tried
Connection con;
String databaseURL =
"jdbc:firebirdsql:192.168.0.115/3050:/home/firebird/data/employee.fdb";
String user = "sysdba";
String password = "pass";
//String driverName = "org.firebirdsql.jdbc.FBDriver";
//Load driver
Class.forName("org.firebirdsql.jdbc.FBDriver");
//Attempt to connect to a driver.
con = DriverManager.getConnection(databaseURL, user, password);
//Create a Statement object
stmt = con.createStatement();
result = stmt.executeQuery ("select full_name from employee where salary <
50000");
and this is his error
org.apache.jasper.JasperException: Unable to compile class for
JSP/usr/java/jakarta-tomcat-3.2.3/work/192.10.10.20_8080/_0002fconnect_00033
_0002ejspconnect3_jsp_12.java:83: Undefined variable: stmt
stmt = con.createStatement();
^
/usr/java/jakarta-tomcat-3.2.3/work/192.10.10.20_8080/_0002fconnect_00033_00
02ejspconnect3_jsp_12.java:85: Undefined variable: result
result = stmt.executeQuery ("select
full_name from employee where salary < 50000");
^
/usr/java/jakarta-tomcat-3.2.3/work/192.10.10.20_8080/_0002fconnect_00033_00
02ejspconnect3_jsp_12.java:85: Undefined variable or class name: stmt
result = stmt.executeQuery ("select
full_name from employee where salary < 50000");
Thanks for your help
Richard Drent