Forum Stats

  • 3,757,552 Users
  • 2,251,244 Discussions


How do you create a java.sql.Struct wih Map <String, Object> as argument (Ojdbc8.jar

Hi There

We have proceeded to the migration of most of our code removing deprecated StructDescriptor

in favor of simpler statements such as Struct struct = conn.createStruct(oracleTypeName, objArray); for example

We however have found no equivalent to translate tranform STRUCT into a Struct when it is instanciated wih Map <String, Object> values

Please could you let us know whether there any recommendation to implement such a method when migrating from oracle.sql.STRUCT; to java.sql.STRUCT

private STRUCT createStruct(String oracleTypeName, Connection connection, Map<String, Object> values)

throws SQLException {

StructDescriptor structDescriptor = StructDescriptor.createDescriptor(oracleTypeName, connection);

return new STRUCT(structDescriptor, connection, values);


Note we are using Ojdbc8.jar

Thanks and regards