This article provides troubleshooting tips for accessing Sybase data sources.
To fix the autocommit(true) mode problem, let the application change the connection to chained mode using the Connection.setAutoCommit(false) mode, or use a set chained on language command.
To resolve the stored procedure problem, use the sp_procxmode procedure_name "anymode" command.
This error occurs when XA-style transactions are attempted on a server that does not have Distributed Transaction Management (DTM) installed.
This error is caused by improper use of reserved words. Reserved words cannot be used as column names.
To correct this problem: Rename the variable to remove the reserved word. You can find a list of reserved words in the Sybase Adaptive Server Enterprise Reference Manual; Volume 1: Building Blocks, Chapter 4. This manual is available online at: http://manuals.sybase.com/onlinebooks/group-as/asg1250e/refman.
Problem
java.sql.SQLException: JZ0NE: Incorrect URL format
Cause
The Sybase JDBC drivers that are listed as selections for JDBC provider type in the administrative console do not support IPv6. The administrative console does not contain a pre-formatted template for the Sybase jConnect JDBC driver v6.0 EBF12884, which is the version required to connect to the database in an IPv6 environment.
However, you can still use the administrative console to define the Sybase jConnect JDBC driver v6.0 EBF12884.
Solution
com.sybase.jdbc3.jdbc.SybConnectionPoolDataSource
com.sybase.jdbc3.jdbc.SybXADataSource
SQL Exception: The 'CREATE TABLE' command is not allowed within a multi-statement transaction in the 'tempdb' database. Calling DatabaseMetaData.getBestRowIdentifier()
Case 10880427 has been opened with Sybase to resolve this problem.
To use the escapes and DatabaseMetaData methods, you must install stored procedures on the Adaptive Server Enterprise or Adaptive Server Anywhere database where you want to use these methods. These stored procedures are also required by some of the connection methods.
escape_name map_string --------------------------------- abs abs(%1) acos acos(%1) asin asin(%1) atan atan(%1) atan2 atn2(%1, %2) ceiling ceiling(%1) :::::::::::::::::::::::::::::::::::::::::::::::::::::::: locate charindex ((convert (varchar, %1)), (convert (varchar, %2)))
java IsqlApp -U sa -P -S jdbc:sybase:Tds:hostname:4100 -I %JDBC_HOME%\sp\sql_server12.sql -c go
SVR-ERROR: SQL Exception SELECT INTO command not allowed within multi-statement transaction
Case 10868947 has been opened with Sybase to resolve this problem.
com.sybase.jdbc2.jdbc.SybSQLException: Implicit conversion from data type 'IMAGE' to 'VARBINARY' is not allowed. Use the CONVERT function to run this query.
The error is about a VARBINARY column only and causes confusion if you also have an IMAGE column.
// ***************CORRECTION***************************** // setBinaryStream fails for column type of VARBINARY , use setBytes() instead //stmt4.setBinaryStream(8,new java.io.ByteArrayInputStream(tempbyteArray),tempbyteArray.length); stmt4.setBytes(8,tempbyteArray);
If an application encounters a deadlock, Sybase detects the deadlock and throws an exception. Because of this detection, the transaction manager calls an xa_end with a TMFAIL in it.
The call succeeds, but causes another Sybase exception, XAERR_PROTO. This exception only appears in the error log and does not cause any functional problems. All applications should continue to run, therefore no workaround is necessary.
Case 10869169 has been opened with Sybase to resolve this problem.
at com.sybase.jdbc2.jdbc.SybXAResource.sendRPC(SybXAResource.java:711) at com.sybase.jdbc2.jdbc.SybXAResource.sendRPC(SybXAResource.java:602) at com.sybase.jdbc2.jdbc.SybXAResource.start(SybXAResource.java:312)
This problem affects you when you do both local and global transactions. If, in a local transaction, the autoCommit default value is set to false, and a global or XA transaction starts (either a user transaction started by you, or a container transaction started by a container), the exception occurs.
This problem is a Sybase bug as the start() method can fail unexpectedly, regardless of the value of autoCommit. Currently, there is no workaround for this problem, therefore it is not recommended that you mix local and global transactions. Case 10880792 has been opened to resolve this problem.
Verify that your database name is correctly entered on the data source properties.
Most databases (DB2®, Oracle, Informix® , MS SQL Server and Cloudscape®) throw an exception when the database specified does not exist. But Sybase does not throw an exception when an incorrect database name is specified. Sybase generates an SQL warning and then connects to the default database. If you misspell the requested database name, Sybase connects you to the master or the default database where the table you requested is not found.
If none of these steps fixes your problem, check to see if the problem has been identified and documented by looking at the available online support (hints and tips, technotes, and fixes). If you do not find your problem listed there, contact IBM Support.