dbTalk Databases Forums  

JDBC/JConnect5.5 issue

comp.databases.sybase comp.databases.sybase


Discuss JDBC/JConnect5.5 issue in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ci-Ci Mills
 
Posts: n/a

Default JDBC/JConnect5.5 issue - 12-15-2003 , 10:45 AM






I am using the jConnect5.5 JDBC driver and I have run into an issue
with quoted identifiers.
It seems that quoted identifiers are turned on and I don't see
anything in the API to turn them off.

For example,

String query = "select a, b, c, \"xxx\" from sqlclass..sort1";
ResultSet rs = stmt.executeQuery(query);

I receive the following error:

com.sybase.jdbc.SybSQLException: Invalid column name 'xxx'.

at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Exception.java:42)
at java.sql.SQLException.<init>(SQLException.java:43)

If I use single quotes or set quoted_identifier off...it works fine.
The query above works fine in isql without changing the quoted
identifier setting. Any ideas?

Reply With Quote
  #2  
Old   
Joe Weinstein
 
Posts: n/a

Default Re: JDBC/JConnect5.5 issue - 12-15-2003 , 10:59 AM








Ci-Ci Mills wrote:

Quote:
I am using the jConnect5.5 JDBC driver and I have run into an issue
with quoted identifiers.
It seems that quoted identifiers are turned on and I don't see
anything in the API to turn them off.

For example,

String query = "select a, b, c, \"xxx\" from sqlclass..sort1";
ResultSet rs = stmt.executeQuery(query);

I receive the following error:

com.sybase.jdbc.SybSQLException: Invalid column name 'xxx'.

at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Exception.java:42)
at java.sql.SQLException.<init>(SQLException.java:43)

If I use single quotes or set quoted_identifier off...it works fine.
The query above works fine in isql without changing the quoted
identifier setting. Any ideas?
Two things:
1 - You found the API that sets this behavior, in simply
sending the T-SQL "set quoted_identifier off" via a statement.
2 - What happens in isql if you explicitly turn on quoted identifiers first?

The issue may just be that isal starts up with a different default
than isql, and in either case, you can send SQL to change the
connection behavior.

Joe Weinstein at BEA



Reply With Quote
  #3  
Old   
Ci-Ci Mills
 
Posts: n/a

Default Re: JDBC/JConnect5.5 issue - 12-16-2003 , 10:34 AM



We found the problem. After talking in more detail with our DBA, I
found out that when we upgraded to jConnect5.5 that he just copied
jConn2.jar and did not run the sql scripts that update the
DatabaseMetaData tables. He ran these scripts and the problem is
fixed. Thanks for your help.

Joe Weinstein <joeNOSPAM (AT) bea (DOT) com> wrote

Quote:
Ci-Ci Mills wrote:

I am using the jConnect5.5 JDBC driver and I have run into an issue
with quoted identifiers.
It seems that quoted identifiers are turned on and I don't see
anything in the API to turn them off.

For example,

String query = "select a, b, c, \"xxx\" from sqlclass..sort1";
ResultSet rs = stmt.executeQuery(query);

I receive the following error:

com.sybase.jdbc.SybSQLException: Invalid column name 'xxx'.

at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Exception.java:42)
at java.sql.SQLException.<init>(SQLException.java:43)

If I use single quotes or set quoted_identifier off...it works fine.
The query above works fine in isql without changing the quoted
identifier setting. Any ideas?

Two things:
1 - You found the API that sets this behavior, in simply
sending the T-SQL "set quoted_identifier off" via a statement.
2 - What happens in isql if you explicitly turn on quoted identifiers first?

The issue may just be that isal starts up with a different default
than isql, and in either case, you can send SQL to change the
connection behavior.

Joe Weinstein at BEA

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.