My Oracle Support Banner

Using Database Adapter With a DB2 Connection Executing Custom SQL Fails With " Invalid data conversion". (Doc ID 727807.1)

Last updated on MARCH 12, 2021

Applies to:

Oracle SOA Suite - Version 11.1.1.1.0 and later
Oracle(R) BPEL Process Manager 10g - Version 10.1.3.1 and later
Oracle Enterprise Service Bus - Version 10.1.3 and later
Information in this document applies to any platform.

Symptoms

Using JDeveloper you setup a database connection to a DB2 database as follows:

(A)  Downloaded DB2 Libraries db2jcc.jar, db2jcc_javax.jar & db2jcc_license_cu.jar, created a directory under JDeveloper called db2lib and moved the above files under this directory.
 
(B)  From Jdeveloper setup the DB2 Library
        1. Go to Tools Manage Libraries
        2. Select the User node and then press New
        3. Enter a name for the Library
        4. With Class Path selected, press Add Entry
        5. Add the files (db2jcc.jar, db2jcc_javax.jar & db2jcc_license_cu.jar) for your connection and press Select
        6. With Source Path selected, press Add Entry
        7. Add the files (db2jcc.jar, db2jcc_javax.jar & db2jcc_license_cu.jar) for your connection and press Select
        8. Press OK to create the Library
 
(C)  Create DB Connection
        1. Invoke the Create Database Connection Wizard
        2. On the Type page, select 'Third Party JDBC Driver' as Connection Type and press Next
        3. Enter the Username and Password and press Next
        4. On the Connection page, press New to register the JDBC Driver
        5. Enter the JDBC Driver Class (com.ibm.db2.jcc.DB2Driver) into the Class Name
        6. Select the appropriate Library (Created in Step B) and press OK
        7. Back on the Connection page, enter the appropriate URL jdbc:db2://hostname.domain:port/dbname
             (for example jdbc:db2://test10.us.oracle.com:50000/SAMPLE) and press Next
        8. Test the connection, it should be successful
 
(D)  In a BPEL or ESB project add a DB Adapter, use the above connection and the DB Adapter Wizard, choose the type of operation comes up, select Execute Custom SQL.  As an example of custom SQL enter this:

<!--[if !supportEmptyParas]--> <!--[endif]-->

 

SELECT FIRSTNME FROM ORAFORMS.EMPLOYEE WHERE EMPNO=?

 


From the wizard in JDeveloper, you get the following error:

com.ibm.db2.jcc.b.SqlException: Invalid data conversion: Parameter object type is invalid for requested conversion



Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.