Subject | Re: [firebird-support] Please Help: Function unknown upper?? |
---|---|
Author | Daniel |
Post date | 2003-11-11T09:45:50Z |
Hi David
Thank you very much for looking into this. We are using utility classes to connect efficiently to the database. Your reply encouraged me to bypass these classes to be able to copy and paste something understandable into the reply - and wow it works. The actual problem was that around function names one of the utility classes put double quotes. This should happened only on table and field names.
For other Java users the main method of my test class might be helpful:
public static void main(String[] args){
Connection conn;
String url = "jdbc:firebirdsql:localhost/3050:c:/backoffice/db/OFFICE.DB";
DriverManager.setLoginTimeout(10);
try{
Class.forName("org.firebirdsql.jdbc.FBDriver");
conn = DriverManager.getConnection(url, "SYSDBA", "Y83rUopA");
String query = "select \"Name\", \"FirstName\" from \"Party\" where upper(\"Name\") like 'SANT%'";
CallableStatement cs = conn.prepareCall(query);
ResultSet rs = cs.executeQuery();
while(rs.next()){
System.out.println("Name: " + rs.getString(1) + " First Name: " + rs.getString(2));
}
}catch(SQLException exc){
System.out.println("TestDatabaseConnection >> exc.getSQLState() = " + exc.getSQLState());
exc.printStackTrace();
}catch(Exception sqex){
sqex.printStackTrace();
}finally{
System.out.println("...Testing Done");
System.exit(0);
}
}
Problem is solved, thank you very much and regards
Daniel
Thank you very much for looking into this. We are using utility classes to connect efficiently to the database. Your reply encouraged me to bypass these classes to be able to copy and paste something understandable into the reply - and wow it works. The actual problem was that around function names one of the utility classes put double quotes. This should happened only on table and field names.
For other Java users the main method of my test class might be helpful:
public static void main(String[] args){
Connection conn;
String url = "jdbc:firebirdsql:localhost/3050:c:/backoffice/db/OFFICE.DB";
DriverManager.setLoginTimeout(10);
try{
Class.forName("org.firebirdsql.jdbc.FBDriver");
conn = DriverManager.getConnection(url, "SYSDBA", "Y83rUopA");
String query = "select \"Name\", \"FirstName\" from \"Party\" where upper(\"Name\") like 'SANT%'";
CallableStatement cs = conn.prepareCall(query);
ResultSet rs = cs.executeQuery();
while(rs.next()){
System.out.println("Name: " + rs.getString(1) + " First Name: " + rs.getString(2));
}
}catch(SQLException exc){
System.out.println("TestDatabaseConnection >> exc.getSQLState() = " + exc.getSQLState());
exc.printStackTrace();
}catch(Exception sqex){
sqex.printStackTrace();
}finally{
System.out.println("...Testing Done");
System.exit(0);
}
}
Problem is solved, thank you very much and regards
Daniel
----- Original Message -----
From: dhay@...
To: firebird-support@yahoogroups.com
Sent: Monday, November 10, 2003 9:12 PM
Subject: Re: [firebird-support] Please Help: Function unknown upper??
Errr...not sure what the problem is because I always use the upper function
through JDBC with no problems.
What sql statements are you using? Can you use isql or another tool and
execute it okay?
cheers,
David
"Daniel" <dp@...> on 10/11/2003 12:38:45 PM
Please respond to firebird-support@yahoogroups.com
To: "Mailing List: firebird-support" <firebird-support@yahoogroups.com>
cc:
Subject: [firebird-support] Please Help: Function unknown upper??
Hi All
I urgently need to get functions working in Firebird. If this does not work
soon I have to look for another database - although I started really liking
Firebird. This might fit more into the Java Mailing List but there is
definitely something wrong with that list. All 4 emails I posted (even
through the Yahoo Web site directly) did not appear. Also Helen's promise 4
days ago that it just takes time can not be true because 4 days is just too
long and they are still not there.
Where can I start looking into the problem? I am using Win2K with JayBird
JCA/JDBC Driver version 1.0.1., JRE 1.3.1 and Firebird 1.5 RC6.
I tried different folders, setting the path to all relevant folders. No
matter what but functions just do not work via JDBC. Does anybody know
where
to get the source code for JayBird, which might provide some answers. It
seams not to be available via the usual channels.
I am quite frustrated and I highly appreciate any hint.
Regards
Daniel
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/
[Non-text portions of this message have been removed]