Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Creating STRUCT from Java object is not working as expected using ojdbc8.jar with Spring jdbc

User_C41I0Jun 21 2022

We are seeing the below values when we dump the STRUCT object from the application using Oracle 19c Database. The values for the field "PREFERENCE_KEY" and "PREFERENCE_VALUE" is not getting mapped properly. Could someone please suggest how to fix this issue?

Struct Values: name = TYPE_PREFERENCE_ITEM
length = 5
PREF_ITEM_ID = 5802463
P_ID = 63035
PREFERENCE_KEY = ???
PREFERENCE_VALUE = ???
PARENT_PREF_ID = 0

Code snippet:
StructDescriptor sdesc = StructDescriptor.createDescriptor(
this.structName, wrappedConnection);
STRUCT[] structList = new STRUCT[data.size()];
int count = 0;
for (Map<String, Object> param : data) {
STRUCT struct = new STRUCT(sdesc, wrappedConnection, param);
structList[count++] = struct;
System.out.println("structList - "+count+ " : " + struct.dump());
}

ArrayDescriptor desc = new ArrayDescriptor(typeName, wrappedConnection);
return new ARRAY(desc, wrappedConnection, structList);

Comments

Post Details

Added on Jun 21 2022
0 comments
217 views