| Summary: | @Lob fields don't work on Sybase (includes fix) | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Klaus <klaus.groenbaek> |
| Component: | Eclipselink | Assignee: | Nobody - feel free to take it <nobody> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P2 | CC: | jamesssss, tom.ware |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | submitted_patch | ||
Setting target and priority. See the following page for the meanings of these fields: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines Community: Please vote for this bug if it is important to you. Votes are one of the main criteria we use to determine which bugs to fix next. Fixed to use the correct bind type. The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
Build Identifier: 2.0.0 The Sybase JDBC driver does not support the CLOB and BLOB types (java.sql.Types) I'm using the Sybase JDBC JConn3.jar from the JConnect 6.0 distribution. If you annotate a String field in an Entity with the @LOB annotation EclipseLink uses the CLOB type to read/write data from the field, which result in the following exception on Sybase. java.sql.SQLException: JZ006: Caught IOException: java.io.IOException: JZ0SL: Unsupported SQL type 2005. The fix is simple. In org.eclipse.persistence.platform.database.SybasePlatform override the getJDBCType() method used for resolving types, in the following way public int getJDBCType(Class javaType) { if (javaType == ClassConstants.BLOB) { return Types.LONGVARBINARY; } if (javaType == ClassConstants.CLOB) { return Types.LONGVARCHAR; } return super.getJDBCType(javaType); } Reproducible: Always Steps to Reproduce: 1. Download the JConnect 6 JDBC driver for Sybase 2. Create an Entity with a String field annotated with @Lob 3. try to store the Entity.