Issue Details (XML | Word | Printable)

Key: DERBY-253
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Olav Sandstaa
Reporter: Kathey Marsden
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

Client should throw not implemented exception for depricated setUnicodeStream/getUnicodeStream

Created: 01/May/05 01:33 PM   Updated: 14/May/07 04:38 PM
Return to search
Component/s: JDBC, Network Client
Affects Version/s: 10.1.1.0
Fix Version/s: 10.2.1.6

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works derby253.diff 2006-07-12 07:55 PM Olav Sandstaa 30 kB
Issue Links:
Reference
 

Issue & fix info: Release Note Needed
Resolution Date: 13/Jul/06 05:42 PM


 Description  « Hide
setUnicodeStream and getUnicodeStream are deprecated API's

Network client
PreparedStatement.setUnicodeStream() and ResultSet.getUnicodeStream() should throw not implemented exceptions rather than trying to handle these calls.

Note: The current client implementation of setUnicodeStream() and getUnicodeStream() are broken and can cause unexpected errors

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Daniel John Debrunner made changes - 04/May/05 06:45 AM
Field Original Value New Value
Comment [ 64262 ]
Olav Sandstaa made changes - 24/May/05 05:22 PM
Assignee Olav Sandstaa [ olav ]
Olav Sandstaa made changes - 24/May/05 05:23 PM
Status Open [ 1 ] In Progress [ 3 ]
Olav Sandstaa added a comment - 01/Jun/05 11:41 PM
I have had some problems trying to reproduce this problem based on the description given in the Jira report.

The report refers to the a test named "conn/blobclob4BLOB.java", but I am unable to locate any test with name. There is a test named "jdbcapi/blobclob4BLOB.java" and initially I thought this was the right test to use, but I can not find that this test is doing any calls to setUnicodeStream/getUnicodeStream.

There is a test called "jdbcapi/parameterMapping.java" that does a lot of calls to setUnicodeStream/getUnicodeStream which are disabled when running with the network client. I suspect this is the right test to use for reproducing this problem.

Since I am new to the Derby code and test harness I would appreciate that someone told me if I am on the wrong track to reproduce this problem.

Kathey Marsden added a comment - 02/Jun/05 12:06 AM
Removing out of date test information to clarify the Jira entry.

Kathey Marsden made changes - 02/Jun/05 12:06 AM
Description setUnicodeStream and getUnicodeStream are depricated API's and
not supported for Network client but can throw unexpected
error messages.

To reproduce uncomment the "if (! isDB2jNet)" around unicode
tests in conn/blobclob4BLOB.java

setUnicodeStream and getUnicodeStream are deprecated API's

Network client
PreparedStatement.setUnicodeStream() and PreparedStatement.getUnicodeStream should throw not implemented exceptions rather than trying to handle these calls.

Note: The current client implementation of setUnicodeStream() and getUnicodeStream() are broken and can cause unexpected errors
Kathey Marsden made changes - 02/Jun/05 12:12 AM
Description setUnicodeStream and getUnicodeStream are deprecated API's

Network client
PreparedStatement.setUnicodeStream() and PreparedStatement.getUnicodeStream should throw not implemented exceptions rather than trying to handle these calls.

Note: The current client implementation of setUnicodeStream() and getUnicodeStream() are broken and can cause unexpected errors
setUnicodeStream and getUnicodeStream are deprecated API's

Network client
PreparedStatement.setUnicodeStream() and ResultSet.getUnicodeStream() should throw not implemented exceptions rather than trying to handle these calls.

Note: The current client implementation of setUnicodeStream() and getUnicodeStream() are broken and can cause unexpected errors
Lance Andersen added a comment - 01/Dec/05 11:30 PM
If you are not going to implement this feature, it should throw a SQLException per section 6.2 of the JDBC 3.0 spec (same requirement in JDBC 4 though we are considering adding a new non-transient SQLException as there appears to be a SQLState that we can use... this is under discussion)

Dyre Tjeldvoll made changes - 13/Jun/06 08:30 PM
Priority Minor [ 4 ] Major [ 3 ]
Fix Version/s 10.2.0.0 [ 11187 ]
Component/s JDBC [ 11407 ]
Olav Sandstaa added a comment - 12/Jul/06 07:55 PM
This patch replaces the existing implementation of setUnicodeStream and getUnicodeStream in the client driver to just throw a SQL exception with SQL state equal to feature not implemented.

The following files are changed:

M java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/parameterMapping.out
M java/client/org/apache/derby/client/am/PreparedStatement.java
M java/client/org/apache/derby/client/am/ResultSet.java

The patch is ready for review and commit.

Olav Sandstaa made changes - 12/Jul/06 07:55 PM
Attachment derby253.diff [ 12336734 ]
Olav Sandstaa made changes - 12/Jul/06 07:55 PM
Derby Info [Patch Available]
Repository Revision Date User Message
ASF #421570 Thu Jul 13 09:55:04 UTC 2006 kahatlen DERBY-253: Client should throw not implemented exception for
depricated setUnicodeStream/getUnicodeStream

This patch replaces the existing implementation of setUnicodeStream
and getUnicodeStream in the client driver to just throw a SQL
exception with SQL state equal to feature not implemented.

Patch contributed by Olav Sandstå.
Files Changed
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/parameterMapping.out
MODIFY /db/derby/code/trunk/java/client/org/apache/derby/client/am/ResultSet.java
MODIFY /db/derby/code/trunk/java/client/org/apache/derby/client/am/PreparedStatement.java

Knut Anders Hatlen added a comment - 13/Jul/06 01:39 PM
The patch looks good. I will run some tests and commit it.

Knut Anders Hatlen added a comment - 13/Jul/06 04:55 PM
The tests ran cleanly. Committed revision 421570. Thanks Olav!

Olav Sandstaa added a comment - 13/Jul/06 05:01 PM
Thanks for reviewing and committing this patch, Knut Anders!

Since this patch removes functionality from the client driver (although probably broken functionality), is this something that needs a comment in the release notes?

Olav Sandstaa made changes - 13/Jul/06 05:05 PM
Derby Info [Patch Available]
Olav Sandstaa added a comment - 13/Jul/06 05:42 PM
Verified that the patch is in. Thanks for commiting it, Knut Anders!

Olav Sandstaa made changes - 13/Jul/06 05:42 PM
Resolution Fixed [ 1 ]
Status In Progress [ 3 ] Resolved [ 5 ]
Knut Anders Hatlen added a comment - 13/Jul/06 06:15 PM
Yes, I think we should mention this in the release notes. Here's my proposal:

PROBLEM

PreparedStatement.setUnicodeStream() and ResultSet.getUnicodeStream()
throw SQLException when invoked after upgrading to Apache Derby 10.2.

SYMPTOM

Calling either of these methods will result in an exception with
SQLSTATE 0A000 and message: "Feature not implemented: ..."

CAUSE

PreparedStatement.setUnicodeStream() and ResultSet.getUnicodeStream()
have been deprecated since JDBC 2.0. Derby's implemetation of these
methods was broken, and it was decided that the methods should throw a
not-implemented exception instead of being fixed.

SOLUTION

This was an intentional change. No Derby product solution is offered.

WORKAROUND

Use setCharacterStream() and getCharacterStream() instead of
setUnicodeStream() and getUnicodeStream().

Knut Anders Hatlen made changes - 13/Jul/06 06:15 PM
Derby Info [Release Note Needed]
Olav Sandstaa added a comment - 13/Jul/06 07:40 PM
Knut Anders, thanks for the proposal to release notes. This looks very good.

Kristian Waagan made changes - 31/Jul/06 02:03 PM
Link This issue is related to DERBY-1615 [ DERBY-1615 ]
Kathey Marsden made changes - 14/May/07 04:38 PM
Status Resolved [ 5 ] Closed [ 6 ]