RE: [OJB-developers] Error in JdbcAccess.java
Brought to you by:
thma
From: Matthew B. <ma...@so...> - 2002-06-13 16:26:16
|
I nominate brad for test: 16. CLOB/BLOB/LOB tests. As he reported the bug :) But seriously, this is a really good example of why we need these tests. Thanks for reporting the Issue brad. -----Original Message----- From: Bradley A. Smith [mailto:br...@ba...] Sent: Thursday, June 13, 2002 9:13 AM To: obj...@li... Subject: [OJB-developers] Error in JdbcAccess.java I believe the calls to getSubString and getBytes are incorrect. case Types.CLOB : { java.sql.Clob aClob = rs.getClob(columnId); result = aClob.getSubString(0L, (int) aClob.length()); break; } case Types.BLOB : { java.sql.Blob aBlob = rs.getBlob(columnId); result = aBlob.getBytes(0L, (int) aBlob.length()); break; } According to the Javadoc for java.sql.Blob, the first parameter of getBytes or getSubString is the position, and the first byte/character is at position 1, not position 0. Thanks, Bradley |