Feedback
Did this article resolve your question/issue?

   

Article

Insert Date fails with "The requested parameter metadata is not available for the current statement" exception.

Information

 
TitleInsert Date fails with "The requested parameter metadata is not available for the current statement" exception.
URL NameAS-400-insert-date-fails-as-requested-parameter-metadata-is-not-available
Article Number000187219
EnvironmentProduct: Connect for JDBC DB2
Version: 5.1.4.000154 (F000258.U000115)
OS: Java
Database: DB2
Application: all supported applications
Question/Problem Description
The mentioned errors are thrown on a PreparedStatement.executeBatch() involving Date data type.
Steps to ReproduceDDL :

create table TAB1 (ENTRY_DATE DATE NOT NULL)

Steps to reproduce :
PreparedStatement pstmt1 = con.prepareStatement("insert into TAB1 ( ENTRY_DATE ) values ( ? )");
pstmt1.setDate(1, java.sql.Date.valueOf("2016-05-18"));
pstmt1.addBatch();
pstmt1.executeBatch(); // => [DataDirect][DB2 JDBC Driver]Unsupported data conversion.

pstmt1.clearBatch();
pstmt1.clearParameters();

pstmt1.setDate(1, java.sql.Date.valueOf("2016-05-03"));
pstmt1.addBatch();
pstmt1.executeBatch(); // => [DataDirect][DB2 JDBC Driver]The requested parameter metadata is not available for the current statement.
Clarifying Information
The errors only occur when a "DATE NOT NULL" field is involved.
Error Messagecom.ddtek.jdbc.db2base.ddc: [DataDirect][DB2 JDBC Driver]Unsupported data conversion. getUpdateCounts()={} ErrorCode=0 SQLState=HY000
com.ddtek.jdbc.db2base.ddc: [DataDirect][DB2 JDBC Driver]The requested parameter metadata is not available for the current statement. getUpdateCounts()={} ErrorCode=0 SQLState=HY000
Defect NumberDefect 45687
Enhancement Number
Cause
Resolution
Fixed in hot fix  5.1.4.000173 (F000289.U000127).
Refer to “Connect for JDBC hot fix download and install instructions” for instructions on how to download and install the hot fix.
Workaround
Notes
Last Modified Date7/25/2016 8:26 AM
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.