You are using a third-party connection pool to work with Oracle RDBMS.
SqlStructArrayValue
should work with OracleConnection
.
Therefore, you need to make unwrap the physical connection from your connection pool.
OracleConnection oconn = conn.unwrap(OracleConnection.class);
In this case, you need to extend SqlStructArrayValue
and unwrap OracleConnection
from your connection pool.
public class OracleSqlStructArrayValue<T> extends SqlStructArrayValue {
public OracleSqlStructArrayValue(T[] values, StructMapper<T> mapper, String structTypeName) {
super(values, mapper, structTypeName);
}
public OracleSqlStructArrayValue(T[] values, StructMapper<T> mapper, String structTypeName, String arrayTypeName) {
super(values, mapper, structTypeName, arrayTypeName);
}
@Override
protected Object createTypeValue(Connection conn, int sqlType, String typeName) throws SQLException {
if (!conn.isWrapperFor(OracleConnection.class)) {
throw new SQLFeatureNotSupportedException("Oracle types supports only OracleConnection");
}
OracleConnection oconn = conn.unwrap(OracleConnection.class);
return super.createTypeValue(oconn, sqlType, typeName);
}
}