Subject | Re: [Firebird-Java] NEWBEE jdbc connect question |
---|---|
Author | Rick Fincher |
Post date | 2003-11-11T18:32:01Z |
Hi Richard,
You code snippet doesn't show it, so you may have done this already, but
stmt has to be declared as a java.sql.Statement.
i.e. java.sql.Statement stmt = con.createStatement();
It is also choking on <result> which has to be declared as a
java.sql.ResultSet like so:
java.sql.ResultSet result = stmt.executeQuery ("select full_name from
employee where salary < 50000");
Also, it looks like the error is being thrown by Tomcat (or Jasper from
within Tomcat), so I'm assuming you are using the driver with Tomcat or
something that uses Tomcat.
It looks like the driver is being loaded OK, but you should check to see
that all of the necessary jars or firebirdsql-full.jar (which has them all)
are in Tomcat's CATALINA_HOME/common/lib directory.
Hope this helps. If you are still stuck, send me e-mail directly because
this is not really a JayBird issue.
Hope this helps!
Rick
rnf@...
You code snippet doesn't show it, so you may have done this already, but
stmt has to be declared as a java.sql.Statement.
i.e. java.sql.Statement stmt = con.createStatement();
It is also choking on <result> which has to be declared as a
java.sql.ResultSet like so:
java.sql.ResultSet result = stmt.executeQuery ("select full_name from
employee where salary < 50000");
Also, it looks like the error is being thrown by Tomcat (or Jasper from
within Tomcat), so I'm assuming you are using the driver with Tomcat or
something that uses Tomcat.
It looks like the driver is being loaded OK, but you should check to see
that all of the necessary jars or firebirdsql-full.jar (which has them all)
are in Tomcat's CATALINA_HOME/common/lib directory.
Hope this helps. If you are still stuck, send me e-mail directly because
this is not really a JayBird issue.
Hope this helps!
Rick
rnf@...
----- Original Message -----
From: "drentit" <richard@...>
To: <Firebird-Java@yahoogroups.com>
Sent: Saturday, October 11, 2003 8:23 AM
Subject: [Firebird-Java] NEWBEE jdbc connect question
> 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-Java-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>