Forum Stats

  • 3,740,538 Users
  • 2,248,269 Discussions
  • 7,861,320 Comments

Discussions

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

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 19.3.0.0

Thanks and regards

Fabrice

Tagged:
Sign In or Register to comment.