public String substring(int beginIndex, int endIndex)
beginIndexand extends to the character at index
endIndex - 1. Thus the length of the substring is
"hamburger".substring(4, 8) returns "urge" "smiles".substring(1, 5) returns "mile"
beginIndex- the beginning index, inclusive.
endIndex- the ending index, exclusive.
IndexOutOfBoundsException- if the
beginIndexis negative, or
endIndexis larger than the length of this
beginIndexis larger than
Now that Kathey has kicked it back to you and me, how about updating the to-be-released JDBC 4 to point out that a length of zero for the getSubString is valid?
String getSubString(long pos,
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
We might simply add to this description.
length - the number of consecutive characters to be copied; 0 is a valid value
We have a similar case with Blob byte[ ] getBytes().
Can you run this past the expert group for a quick consensus?
On Jul 14, 2006, at 11:13 PM, Kathey Marsden wrote:
Craig L Russell wrote:
You can always work around odd code on the other side of an incompletely defined interface. But you probably have code on the Derby side that also checks for the clob.length() == 0 and take some extraordinary action.I am happy that you agree that the original DDLUtils code was perfectly reasonable at not as Lance described it. I will exit this issue now and allow you, Lance, or someone else with interest determine the correct behavior, check it with Derby and file a Derby bug if needed.
So much easier for neither side to check for zero length and let the natural boundary condition happen.
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!