[ http://issues.apache.org/jira/browse/DERBY-1417?page=all ]
Kristian Waagan updated DERBY-1417: ----------------------------------- Attachment: derby-1417-6d-clientimpl.diff Thanks for the review Knut Anders. I have uploaded revision d of patch 6. See my comments and answers below. 1) You see this bug because you are able to access the Clob-object being used for input to the database. This is a shortcut taken in my implementation, based on the (faulty) assumption that the Clob-object is never passed to the user. Internally, the number of bytes are used. See comment at the bottom. 2) Fixed. The list of supported encodings is found either in the package summary for java.lang (JDK < 1.4), or in the JavaDoc for java.nio.Charset. 3) I have removed it from the constructor I added (which was a copy of the existing one), but left it as it is in the constructor that was already there. I think that change belong in a separate cleanup-patch. Note that I also removed the block for UTF-8 encoding, as this is never used for length less Clobs (encoding is always US-ASCII when passing an InputStream - set-/updateAsciiStream). I left the encoding argument for now, along with the check. This is handy when/if we change to ISO-8859-1. Besides from that, the encoding argument could be removed from this constructor (Agent,InputStream,String). 4) Fixed this for the constructor I added. Again I suggest a separate cleanup-patch for the other constructor. 5) Fixed. 6) Fixed. I also removed an unused import. 7) Fixed (deleted setUp and tearDown). 8) Changed. As you can see, I have chosen not to address some of your comments on the code that is not directly related to my patch. I don't want to mix other bug fixes and improvements with my patch for this issue. One of the main reasons for this, is that the faulty assumption that a Clob used for input is not passed to the user is used for the whole implementation, not just mine. In my opinion, Clob is ready for a cleanup/rewrite and this should be done separately from this issue. Thanks, > Add new, lengthless overloads to the streaming api > -------------------------------------------------- > > Key: DERBY-1417 > URL: http://issues.apache.org/jira/browse/DERBY-1417 > Project: Derby > Issue Type: New Feature > Components: JDBC > Affects Versions: 10.2.0.0 > Reporter: Rick Hillegas > Assigned To: Kristian Waagan > Fix For: 10.2.0.0 > > Attachments: derby-1417-01-castsInTests.diff, > derby-1417-1a-notImplemented.diff, derby-1417-1a-notImplemented.stat, > derby-1417-2a-rstest-refactor.diff, derby-1417-3a-embimpl-and-tests.diff, > derby-1417-3a-embimpl-and-tests.stat, derby-1417-3b-embimpl-and-tests.diff, > derby-1417-3b-embimpl-and-tests.stat, derby-1417-4a-disable-psTestsDnc.diff, > derby-1417-5a-brokered.diff, derby-1417-5a-brokered.stat, > derby-1417-6a-clientimpl.diff, derby-1417-6a-clientimpl.stat, > derby-1417-6b-clientimpl.diff, derby-1417-6c-clientimpl.diff, > derby-1417-6d-clientimpl.diff > > > The JDBC4 Expert Group has approved a new set of overloads for the streaming > methods. These overloads do not take a length argument. Here are the new > overloads: > PreparedStatement.setAsciiStream(int parameterIndex, java.io.InputStream x) > PreparedStatement.setBinaryStream(int parameterIndex, java.io.InputStream x) > PreparedStatement.setCharacterStream(int parameterIndex, java.io.Reader > reader) > PreparedStatement.setNCharacterStream(int parameterIndex, java.io.Reader > reader) > PreparedStatement.setBlob(int parameterIndex, java.io.InputStream inputStream) > PreparedStatement.setClob(int parameterIndex, java.io.Reader reader) > PreparedStatement.setNClob(int parameterIndex, java.io.Reader reader) > CallableStatement.setAsciiStream(java.lang.String parameterName, > java.io.InputStream x) > CallableStatement.setBinaryStream(java.lang.String parameterName, > java.io.InputStream x) > CallableStatement.setCharacterStream(java.lang.String parameterName, > java.io.Reader reader) > CallableStatement.setNCharacterStream(java.lang.String parameterName, > java.io.Reader reader) > CallableStatement.setBlob(java.lang.String parameterName, java.io.InputStream > inputStream) > CallableStatement.setClob(java.lang.String parameterName, java.io.Reader > reader) > CallableStatement.setNClob(java.lang.String parameterName, java.io.Reader > reader) > ResultSet.updateAsciiStream(int columnIndex, java.io.InputStream x) > ResultSet.updateAsciiStream(java.lang.String columnLabel, java.io.InputStream > x) > ResultSet.updateBinaryStream(int columnIndex, java.io.InputStream x) > ResultSet.updateBinaryStream(java.lang.String columnLabel, > java.io.InputStream x, int length) > ResultSet.updateCharacterStream(int columnIndex, java.io.Reader x) > ResultSet.updateCharacterStream(java.lang.String columnLabel, java.io.Reader > x) > ResultSet.updateNCharacterStream(int columnIndex, java.io.Reader x) > ResultSet.updateNCharacterStream(java.lang.String columnLabel, java.io.Reader > x) > ResultSet.updateBlob(int columnIndex, java.io.InputStream inputStream) > ResultSet.updateBlob(java.lang.String columnLabel, java.io.InputStream > inputStream) > ResultSet.updateClob(int columnIndex, java.io.Reader reader) > ResultSet.updateClob(java.lang.String columnLabel, java.io.Reader reader) > ResultSet.updateNClob(int columnIndex, java.io.Reader reader) > ResultSet.updateNClob(java.lang.String columnLabel, java.io.Reader reader) > We should add these new overloads soon so that the build will not break when > this methods turn up in a published Mustang build. -- 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