88import org .utplsql .api .db .DynamicParameterList ;
99
1010import java .sql .CallableStatement ;
11+ import java .sql .Connection ;
1112import java .sql .SQLException ;
1213
1314public class DynamicTestRunnerStatement implements TestRunnerStatement {
@@ -66,16 +67,21 @@ private DynamicParameterList initParameterList() throws SQLException {
6667 }
6768
6869 private void prepareStatement () throws SQLException {
69- if ( stmt == null )
70- oracleConnection .prepareCall (dynamicParameterList .getSql ());
70+ if ( stmt == null ) {
71+ String sql = "BEGIN " +
72+ "ut_runner.run(" +
73+ dynamicParameterList .getSql () +
74+ ");" +
75+ "END;" ;
76+ stmt = oracleConnection .prepareCall (sql );
77+ }
7178
7279 dynamicParameterList .setParamsStartWithIndex (stmt , 1 );
7380 }
7481
7582 @ Override
7683 public void execute () throws SQLException {
77-
78- // Implement
84+ stmt .execute ();
7985 }
8086
8187 @ Override
@@ -90,7 +96,8 @@ public void close() throws SQLException {
9096 }
9197 }
9298
93- public static DynamicTestRunnerStatement forVersion (Version version , OracleConnection connection , TestRunnerOptions options , CallableStatement statement ) throws SQLException {
94- return new DynamicTestRunnerStatement (version , connection , options , statement );
99+ public static DynamicTestRunnerStatement forVersion (Version version , Connection connection , TestRunnerOptions options , CallableStatement statement ) throws SQLException {
100+ OracleConnection oraConn = connection .unwrap (OracleConnection .class );
101+ return new DynamicTestRunnerStatement (version , oraConn , options , statement );
95102 }
96103}
0 commit comments