Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a574cee

Browse files
author
Jacek Gębal
committed
Changed Reporter initialization to use UT_OUTPUT_REPORTER_BASE instead of UT_REPORTER_BASE.
Oracle JDBC 23.x sends the reporter STRUCT typed as UT_OUTPUT_REPORTER_BASE. Assigning UT_OUTPUT_REPORTER_BASE to a concrete subtype variable fails with PLS-00382
1 parent 8c6602c commit a574cee

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/main/java/org/utplsql/api/outputBuffer/DefaultOutputBuffer.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@ class DefaultOutputBuffer extends AbstractOutputBuffer {
2727

2828
@Override
2929
protected CallableStatement getLinesCursorStatement(Connection conn) throws SQLException {
30-
Reporter reporter = getReporter();
31-
String plsql = "DECLARE l_rep " + reporter.getTypeName() + "; "
30+
String plsql = "DECLARE l_rep ut_output_reporter_base; "
3231
+ "BEGIN l_rep := :2; :1 := l_rep.get_lines_cursor(); END;";
3332
OracleCallableStatement cstmt = (OracleCallableStatement) conn.prepareCall(plsql);
3433
cstmt.registerOutParameter(1, OracleTypes.CURSOR);
35-
cstmt.setORAData(2, reporter);
34+
cstmt.setORAData(2, getReporter());
3635
return cstmt;
3736
}
3837
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public Reporter init(Connection con) throws SQLException {
6868
*/
6969
private void initDbReporter(OracleConnection oraConn, ReporterFactory reporterFactory) throws SQLException {
7070
OracleCallableStatement callableStatement = (OracleCallableStatement) oraConn.prepareCall("{? = call " + selfType + "()}");
71-
callableStatement.registerOutParameter(1, OracleTypes.STRUCT, "UT_REPORTER_BASE");
71+
callableStatement.registerOutParameter(1, OracleTypes.STRUCT, "UT_OUTPUT_REPORTER_BASE");
7272
callableStatement.execute();
7373

7474
Reporter obj = (Reporter) callableStatement.getORAData(1, reporterFactory);

0 commit comments

Comments
 (0)