Subject Re: OT NEWBEE jdbc connect question
Author Maciek BOROWKA
Your question is a java one, not jdbc and not firebird...

A java forum or mailing list would be more appropriate if you
want a quick answer...

And BTW, you forget to declare your stmt and result variables,
put:
Statement stmt = null;
ResultSet result = null;
in the beginning of the block. It will work :+)

./Maciek

>>> richard@... 10/10/03 09h47 >>>


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









To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com



Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/