Issue Details (XML | Word | Printable)

Key: DERBY-3430
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Kathey Marsden
Reporter: A B
Votes: 0
Watchers: 0
Operations

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

Inconsistency in JDBC autogen APIs between Connection.prepareStatement(...) and Statement.execute(...)

Created: 19/Feb/08 04:09 AM   Updated: 21/Mar/08 05:42 PM
Return to search
Component/s: JDBC
Affects Version/s: 10.3.1.4, 10.4.1.3
Fix Version/s: 10.4.1.3

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works derby-3430_diff.txt 2008-02-20 12:55 AM Kathey Marsden 2 kB

Resolution Date: 20/Feb/08 07:19 PM


 Description  « Hide
In EmbedStatement.java the execute(String, String[]), execute(String, int[]), executeUpdate(String, String[]), and executeUpdate(String, int[]) methods treat a 0-length array to mean NO_GENERATED_KEYS. But in EmbedConnection.java the prepareStatement(String, String[]) and prepareStatement(String, int[]) methods treat a 0-length array to mean RETURN_GENERATED_KEYS. For the sake of consistency, the two classes should treat 0-length arrays in the same way--which probably means changing EmbedConnection to match EmbedStatement.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Kathey Marsden added a comment - 20/Feb/08 12:55 AM
Attached is a simple patch for this issue which changes EmbedConnection to use NO_GENERATED_KEYS for zero length columnNames or columnIndexes arrays. I will check this in after the patch for DERBY-2653 as the test will conflict.


Kathey Marsden added a comment - 20/Feb/08 07:19 PM
Fixed in trunk with revision 629578