db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Waagan <Kristian.Waa...@Sun.COM>
Subject Re: [jira] Updated: (DERBY-1417) Add new, lengthless overloads to the streaming api
Date Wed, 26 Jul 2006 15:15:48 GMT
TomohitoNakayama wrote:
> Hello Kristian.
> 
> Thank you for taking my consideration into the patch and fix failure in 
> the name of class !
> 
> One more my opinion ....
> In some encodings, such as UTF-16 "with Byte Order Mark" or ISO-2022-JP,
> length of encoded bytes array is not just multiple of characters count.
> 
> In those cases, length of Byte Order Mark or escape sequences is needed 
> to be added and
> maxBytesPerChar approach can be a nasty trap.
> 
> I think simple honest approach would be better.
> Such as passing max count of characters and max count of encoded bytes 
> array directly to constructor.
> 
> I hope you to take this opinion into account...

Hi Tomohito,

Sure, your solution is better and more flexible.

I don't agree maxBytesPerChar is a nasty trap, because the byte array 
will grow as needed. I'll upload another patch.



Thanks,
-- 
Kristian

> 
> Best regards.
> 
> Kristian Waagan (JIRA) wrote:
> 
>>     [ http://issues.apache.org/jira/browse/DERBY-1417?page=all ]
>>
>> Kristian Waagan updated DERBY-1417:
>> -----------------------------------
>>
>>    Attachment: derby-1417-6b-clientimpl.diff
>>
>> 'derby-1417-6b-clientimpl.diff' deprecates 6a.
>> Changes:
>> 1) Add missing license to two files.
>> 2) Added static factory methods to EncodedInputStream for UTF-8- and 
>> UTF-16BE-streams.
>>     Set byte buffer size to 3 and 2 times size of char buffer, 
>> respectively.
>>     'createUTF8Stream' is public, 'createUTF16BEStream' is package 
>> private.
>>     I made class 'EncodedInputStream' public final, and its 
>> constructor private.
>> 3) Updated two classes (Request and Clob) to use the new static methods.
>>
>> When applying patch, do a 'svn rename 
>> java/client/org/apache/derby/client/net/UTF32BEEncodedInputStream.java 
>> java/client/org/apache/derby/client/net/EncodedInputStream.java' 
>> first. Just press ENTER (answer no) at the two prompts when running 
>> the patch tool.
>>
>>  
>>
>>> 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
>>>
>>>
>>> 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.
>>>   
>>
>>  
>>
> 


Mime
View raw message