Sybase ASE query errors not indicating the line numbers of the error within the query. The problem is caused by jConnect7.
Executing this query :
select * from Customers
select * from Customers
select * rom Customers
Gives you these results with ADS 12 w/ jConnect7
>[Error] Script lines: 1-4 --------------------------
Incorrect syntax near 'rom'.
And gives you these results with ADS 12 w/ jConnect 6
>[Error] Script lines: 1-4 --------------------------
Incorrect syntax near 'rom'.
Msg: 102, Level: 15, State: 1
Server: SybaseASE15, Line: 3
jConnect6 throws the exception class type "com.sybase.jdbc3.jdbc.SybSQLException", while jConnect7 throws the exception class type "java.sql.SQLException". The class com.sybase.jdbc3.jdbc.SybSQLException has the line number, so jConnect7 is not returning the line numbers.
![]() |
1 KB
![]() |
1 KB
|
48 KB
The jconnect7.jar file does contain the com.sybase.jdbc4.jdbc.SybSQLException, which we do handle, but the driver doesn't throw the exception with the case above.
I've attached two Java examples which illustrate the exceptions thrown by jconnect7 and jconnect6 which are :
jconnect7 ....
java.sql.SQLException: Incorrect syntax near '@@version'.
at com.sybase.jdbc4.jdbc.SybConnection.getAllExceptions(SybConnection.java:2526)
at com.sybase.jdbc4.jdbc.SybStatement.handleSQLE(SybStatement.java:2323)
at com.sybase.jdbc4.jdbc.SybStatement.nextResult(SybStatement.java:276)
at com.sybase.jdbc4.jdbc.SybStatement.nextResult(SybStatement.java:253)
at com.sybase.jdbc4.jdbc.SybStatement.executeLoop(SybStatement.java:2252)
at com.sybase.jdbc4.jdbc.SybStatement.execute(SybStatement.java:2239)
at com.sybase.jdbc4.jdbc.SybStatement.execute(SybStatement.java:1078)
at com.aquafold.tools.db.SybaseExceptionExample.main(SybaseExceptionExample.java:53)
jconnect6 ...
com.sybase.jdbc3.jdbc.SybSQLException: Incorrect syntax near '@@version'.
at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source)
at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(Unknown Source)
at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
at com.sybase.jdbc3.jdbc.SybStatement.executeLoop(Unknown Source)
at com.sybase.jdbc3.jdbc.SybStatement.execute(Unknown Source)
at com.sybase.jdbc3.jdbc.SybStatement.execute(Unknown Source)
at com.aquafold.tools.db.SybaseExceptionExample.main(SybaseExceptionExample.java:53)
I've attached two Java examples which illustrate the exceptions thrown by jconnect7 and jconnect6 which are :
jconnect7 ....
java.sql.SQLException: Incorrect syntax near '@@version'.
at com.sybase.jdbc4.jdbc.SybConnection.getAllExceptions(SybConnection.java:2526)
at com.sybase.jdbc4.jdbc.SybStatement.handleSQLE(SybStatement.java:2323)
at com.sybase.jdbc4.jdbc.SybStatement.nextResult(SybStatement.java:276)
at com.sybase.jdbc4.jdbc.SybStatement.nextResult(SybStatement.java:253)
at com.sybase.jdbc4.jdbc.SybStatement.executeLoop(SybStatement.java:2252)
at com.sybase.jdbc4.jdbc.SybStatement.execute(SybStatement.java:2239)
at com.sybase.jdbc4.jdbc.SybStatement.execute(SybStatement.java:1078)
at com.aquafold.tools.db.SybaseExceptionExample.main(SybaseExceptionExample.java:53)
jconnect6 ...
com.sybase.jdbc3.jdbc.SybSQLException: Incorrect syntax near '@@version'.
at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source)
at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(Unknown Source)
at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
at com.sybase.jdbc3.jdbc.SybStatement.executeLoop(Unknown Source)
at com.sybase.jdbc3.jdbc.SybStatement.execute(Unknown Source)
at com.sybase.jdbc3.jdbc.SybStatement.execute(Unknown Source)
at com.aquafold.tools.db.SybaseExceptionExample.main(SybaseExceptionExample.java:53)
I've logged an issue with SAP/Sybase as :
Case Id: 11760507 - jConnect returning java.sql.SQLException when SybSQLException is desired
I've logged an issue with SAP/Sybase as :
Case Id: 11760507 - jConnect returning java.sql.SQLException when SybSQLException is desired
Temporary work around :
1. Close ADS 12
2. Copy from ADS 11 <ADS_11_HOME>\lib\drivers\jconnect6.jar to ADS 12 in <ADS_12_HOME>\lib\drivers\
3. Rename <ADS_12_HOME>\lib\drivers\jconnect7.jar to jconnect7.txt
4. Restart ADS and it should work
Temporary work around :
1. Close ADS 12
2. Copy from ADS 11 <ADS_11_HOME>\lib\drivers\jconnect6.jar to ADS 12 in <ADS_12_HOME>\lib\drivers\
3. Rename <ADS_12_HOME>\lib\drivers\jconnect7.jar to jconnect7.txt
4. Restart ADS and it should work
Since we had to revert the jConnect driver to the same version bundled with ADS 13.0, this is still an issue. Will update once we update the drivers end of August.
Since we had to revert the jConnect driver to the same version bundled with ADS 13.0, this is still an issue. Will update once we update the drivers end of August.
Looks like this problem is fixed in jConnect16
Looks like this problem is fixed in jConnect16
This is fixed in the latest jconnect versions. Verified in ADS v18-alpha-7
This is fixed in the latest jconnect versions. Verified in ADS v18-alpha-7
Issue #7858 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build 15.0.0-dev-310 |
No time estimate |
The jconnect7.jar file does contain the com.sybase.jdbc4.jdbc.SybSQLException, which we do handle, but the driver doesn't throw the exception with the case above.