Skip to content

Commit 4c4fe12

Browse files
committed
Replaced deprecated Oracle-STRUCT with Struct-Interface
1 parent 2f9f4dc commit 4c4fe12

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/main/java/org/utplsql/api/reporter/Reporter.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
import oracle.jdbc.OracleTypes;
66
import oracle.sql.Datum;
77
import oracle.sql.ORAData;
8-
import oracle.sql.STRUCT;
9-
import oracle.sql.StructDescriptor;
108
import org.utplsql.api.compatibility.CompatibilityProxy;
119
import org.utplsql.api.outputBuffer.OutputBuffer;
1210

@@ -103,9 +101,7 @@ public String getId() {
103101

104102
public Datum toDatum(Connection c) throws SQLException
105103
{
106-
StructDescriptor sd =
107-
StructDescriptor.createDescriptor(getTypeName(), c);
108-
return new STRUCT(sd, c, getAttributes());
104+
return (Datum)c.createStruct(getTypeName(), getAttributes());
109105
}
110106

111107
public OutputBuffer getOutputBuffer() {

src/main/java/org/utplsql/api/reporter/ReporterFactory.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
import oracle.sql.Datum;
44
import oracle.sql.ORAData;
55
import oracle.sql.ORADataFactory;
6-
import oracle.sql.STRUCT;
76
import org.utplsql.api.compatibility.CompatibilityProxy;
87

98
import java.sql.SQLException;
9+
import java.sql.Struct;
1010
import java.util.HashMap;
1111
import java.util.Map;
1212
import java.util.function.BiFunction;
@@ -117,9 +117,9 @@ public Map<String, String> getRegisteredReporterInfo() {
117117
@Override
118118
public ORAData create(Datum d, int sqlType) throws SQLException {
119119
if (d == null) return null;
120-
if ( d instanceof STRUCT) {
121-
String sqlName = ((STRUCT)d).getDescriptor().getName();
122-
return createReporter(sqlName, ((STRUCT)d).getAttributes());
120+
if ( d instanceof Struct) {
121+
String sqlName = ((Struct)d).getSQLTypeName();
122+
return createReporter(sqlName, ((Struct)d).getAttributes());
123123
}
124124

125125
return null;

0 commit comments

Comments
 (0)