[
https://issues.apache.org/jira/browse/DERBY-2769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12693493#action_12693493
]
Kristian Waagan commented on DERBY-2769:
----------------------------------------
> myClob.setString(0, "bryan", 0, 0);
I think you may get into trouble with that one due to the invalid insert
position, but I guess this should work (and return zero):
myClob.setString(1, "bryan", 0, 0);
I also think we have discussed the following note from the JavaDoc, but I don't
remember where we discussed it:
"If the value specified for pos is greater then the length+1 of the CLOB value
then the behavior is undefined. Some JDBC drivers may throw a SQLException
while other drivers may support this operation. "
This may be handled properly already for setString, but it wouldn't hurt to
confirm it.
> Implement error handling/parameter checking in Clob.setString
> -------------------------------------------------------------
>
> Key: DERBY-2769
> URL: https://issues.apache.org/jira/browse/DERBY-2769
> Project: Derby
> Issue Type: Bug
> Components: JDBC
> Affects Versions: 10.3.1.4
> Reporter: Kristian Waagan
> Assignee: Yun Lee
> Attachments: DERBY-2769-1.patch, DERBY-2769-1.stat
>
>
> The error handling, or parameter checking, in Clob.subString is not adequate.
> There are four parameters that can be invalid;
> * pos
> * str
> * offset
> * len
> The first one is already handled properly, the remaining three are not. They
> typically result in some low-level exception like a NPE.
> I have not found anything in the JDBC specification nor JavaDoc that dictates
> the behavior, except for that SQLException should use states defined in the
> SQL 2003 specification. A brief search there resulted in the following
> possibilities:
> 22003 - numeric value out of range
> 22004 - null value not allowed
> 2200F - zero-length character string
> 22011 - substring error
> 22023 - invalid parameter value
> Some of these are already defined by Derby, but with unsuitable or very
> specific error messages.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.