[ http://issues.apache.org/jira/browse/DERBY-1147?page=all ]
Kristian Waagan updated DERBY-1147: ----------------------------------- Attachment: derby-1147-2a-getcharacterstream.stat derby-1147-2a-getcharacterstream.diff 'derby-1147-2a-getcharacterstream.diff' is a *preliminary* patch implementing CallableStatement.getCharacterStream(int). Since I have little knowledge about this part of Derby, I would like to get some feedback from people more familiar with this code. The method is implemented for both client and embedded mode, and I have written some tests. The implementation is based on existing code in other parts of Derby. The supported types are taken from table B-6 of the JDBC4 spec, and seems to be in agreement with existing Derby methods. Some questions and obervations: 1) testGetCharacterStreamIntOnInParameterOfInvalidType fails for embedded (see point 7 below). 2) I have not taken maximum length into consideration (data truncation), as I read the JavaDoc as setMaxField only applies to ResultSet. Correct me if this is wrong. 3) Is the usage of setupContextStack/restoreContextStack correct and necessary? Why? 4) Should the embedded implementation be moved to EmbedCallableStatement20? 5) Have I forgotten some internal variables that must be maintained? 6) Support for Clob and Blob are included, although these types are not allowed (yet) as parameters in CallableStatement in Derby. 7) Due to a bit different designs/implementations, getCharacterStream will throw different exceptions when calling it on an IN parameter of a non-supported type (for instance DOUBLE). On the client side it will correctly state that the parameter is not an OUT/INOUT parameter, while the embedded side complains about a data conversion error. There are at least two ways to fix this: A) duplicate check code from GenericParameterValueSet.getParameterForGet and call it before switch block in getCharacterStream B) call GenericParameterValueSet.getParameterForGet before switch block in getCharacterStream, even for invalid data types Any opinions on the best way to solve this? Have I overlooked some existing functionality I can use? I will keep working on this, and feedback and pieces of advice is appreciated. > Implement miscellaneous CallableStatement methods added by JDBC4 > ---------------------------------------------------------------- > > Key: DERBY-1147 > URL: http://issues.apache.org/jira/browse/DERBY-1147 > Project: Derby > Type: Improvement > Components: JDBC > Versions: 10.2.0.0 > Reporter: Rick Hillegas > Assignee: Kristian Waagan > Attachments: derby-1147-1a-missing-methods.diff, > derby-1147-1a-missing-methods.stat, derby-1147-2a-getcharacterstream.diff, > derby-1147-2a-getcharacterstream.stat > > These are described in the overview section 3.1 of the JDBC4 spec: > "Added the methods getRowId, setRowId, getNClob, getNString, > getCharacterStream, getNCharacterStream, setNString, > setNCharacterStream, setNClob, getSQLXML, setSQLXML. > Overloaded the setClob and setBlob methods." > Most of these methods will throw SQLFeatureNotSupporteException because our > client drivers do not support the ROWID, National String, and XML datatypes. > However, we should implement the getCharacterStream() method and the > setClob() and setBlob() overloads. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira