[ 
https://issues.apache.org/jira/browse/DERBY-6000?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rick Hillegas updated DERBY-6000:
---------------------------------

    Attachment: derby-6000-09-ac-setObjectPS.diff

Attaching derby-6000-09-ac-setObjectPS.diff. This patch adds support for the 
new PreparedStatement.setObject() overloads added by JDBC 4.2. I am running 
tests now.

Adds the following methods to the embedded and client drivers:

  PreparedStatement.setObject(int parameterIndex, java.lang.Object x, SQLType 
targetSqlType)
  PreparedStatement.setObject(int parameterIndex, java.lang.Object x, SQLType 
targetSqlType, int scaleOrLength)

The new overloads implement the following logic:

a) Raise an exception if SQLType is not a JDBCType whose corresponding type in 
java.sql.Types is supported by Derby.

b) Otherwise forward the call to the corresponding setObject() overload, using 
the corresponding type from java.sql.Types.

This patch adds a new JDBC 4.2 module to the engine. Additional JDBC 4.2 work 
can expand this module. Some temporary build logic has been added to allow the 
build to succeed if you are building with a version of Java before version 8. 
We can remove this temporary logic once Java 8 goes live and we can create JDBC 
4.2 stubs parallel to the stubs for previous JDBC versions.

Touches the following files:

----------

M       java/build/org/apache/derbyBuild/classlister.java
M       java/engine/org/apache/derby/iapi/jdbc/build.xml
M       java/engine/org/apache/derby/impl/jdbc/build.xml
M       java/engine/org/apache/derby/jdbc/build.xml
M       java/engine/org/apache/derby/modules.properties
M       java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/build.xml

Build logic.

----------

M       java/engine/org/apache/derby/iapi/types/HarmonySerialBlob.java
M       java/engine/org/apache/derby/iapi/types/SQLBlob.java

Removed an unneeded exception declaration from a HarmonySerialBlob constructor.

----------

M       
java/shared/org/apache/derby/shared/common/reference/JDBC40Translation.java
M       java/engine/org/apache/derby/iapi/types/TypeId.java

JDBC 4.2 adds a new type id: REF_CURSOR.

----------

M       java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection40.java
A       java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection42.java
A       java/engine/org/apache/derby/jdbc/Driver42.java

New JDBC 4.2 engine module.

----------

M       java/client/org/apache/derby/client/am/CrossConverters.java

The tests for this patch tripped over an existing bug in the client driver: 
PreparedStatement.setObject( int, Object, int ) fails if you are trying to set 
a UDT. The simpler overload of this method (setObject( int, Object )) was 
tested and worked. I have added a little logic to make the failing overload 
work in this case. The overload which used to fail is tested by the new tests 
added for this feature.

----------

A       java/engine/org/apache/derby/iapi/jdbc/BrokeredPreparedStatement42.java
A       java/engine/org/apache/derby/impl/jdbc/Util42.java
A       java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement42.java
M       java/engine/org/apache/derby/impl/jdbc/ConnectionChild.java
M       java/engine/org/apache/derby/impl/jdbc/Util.java
M       java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java

Embedded support for the new PreparedStatement.setObject() overloads.

----------

M       
java/client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl42.java
M       java/client/org/apache/derby/client/am/PreparedStatement.java
A       java/client/org/apache/derby/client/am/LogicalPreparedStatement42.java
A       java/client/org/apache/derby/client/am/PreparedStatement42.java
A       java/client/org/apache/derby/client/am/Utils42.java

Client support for the new PreparedStatement.setObject() overloads.

----------

M       java/testing/org/apache/derbyTesting/functionTests/tests/lang/Price.java
M       
java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/_Suite.java
A       
java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/PreparedStatementTest42.java
 
Tests for the new overloads. The tests execute if you are running on Java 8 or 
higher.

                
> Implement support for JDBC 4.2
> ------------------------------
>
>                 Key: DERBY-6000
>                 URL: https://issues.apache.org/jira/browse/DERBY-6000
>             Project: Derby
>          Issue Type: Improvement
>          Components: JDBC
>            Reporter: Rick Hillegas
>         Attachments: derby-6000-01-aa-executeLargeUpdateEmbedded.diff, 
> derby-6000-02-ad-executeLargeUpdateClient.diff, 
> derby-6000-03-aa-executeLargeBatch.diff, 
> derby-6000-04-aa-setLargeMaxRows.diff, 
> derby-6000-05-aa-executeLargeUpdatePS.diff, 
> derby-6000-06-aa-DatabaseMetaData.diff, 
> derby-6000-07-ab-batchUpdateException.diff, 
> derby-6000-08-aa-batchUpdateExceptionConstructor.diff, 
> derby-6000-09-ac-setObjectPS.diff, JDBC_4.2_Changes.html
>
>
> Open JDK 8 will include maintenance rev 4.2 of JDBC. The public discussion of 
> JDBC 4.2 will take place here: http://openjdk.java.net/jeps/170. We will want 
> to build Derby support for JDBC 4.2 after a public spec appears. At this 
> time, it is unclear what Derby release will carry this support.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to