db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lance J. Andersen" <Lance.Ander...@Sun.COM>
Subject Re: should Clob.getSubstring() allow length of 0?
Date Sat, 15 Jul 2006 01:12:29 GMT
Derby is correct.  The clarified JDBC 4 javadocs indicates the following:


java.lang.String *getSubString*(long pos,
                              int length)
                              throws SQLException <http://jse.east.sun.com/%7Elancea/javadoc-spec/java/sql/SQLException.html>

    Retrieves a copy of the specified substring in the |CLOB| value
    designated by this |Clob| object. The substring begins at position
    |pos| and has up to |length| consecutive characters.

        |pos| - the first character of the substring to be extracted.
        The first character is at position 1.
        |length| - the number of consecutive characters to be copied 
        a |String| that is the specified substring in the |CLOB| value
        designated by this |Clob| object 
        - if there is an error accessing the |CLOB| value or if pos is
        less than 1 
        - if the JDBC driver does not support this method

Hopefully you will find many mysteries solved in JDBC 4 (and yes i am 
sure there are still some, but we knocked a ton of the off)

Kathey Marsden wrote:
> In this  recent thread the question came up.
> http://www.nabble.com/The-tutorial-on-migrating-DB-to-derby-tf1787729.html#a4874605 
> Derby does not allow a length of 0 for Clob.getSubstring().
> Is this a bug in Derby?  I am not sure from reading the javadoc:
> http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Clob.html#getSubString(long,%20int)

> Kathey

View raw message