Skip to content

Commit

Permalink
Add prepared statement double execution test
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasHafner committed Mar 27, 2024
1 parent a30c760 commit b2848db
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/test/java/org/polypheny/jdbc/StatementTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,27 @@ void testPreparedStatementDualExecCleanup() throws SQLException {
p.setInt( 2, 5 );
p.execute();
}
System.out.println("done");
try ( Statement statement = con.createStatement() ) {
statement.execute( "DROP TABLE IF EXISTS t" );
}
System.out.println("done2");
}

@Test
void testPreparedStatementDualExecUpdate() throws SQLException {
try ( PreparedStatement p = con.prepareStatement( "INSERT INTO t(id, a) VALUES (?, ?)" ) ) {
p.setInt( 1, 4 );
p.setInt( 2, 4 );
p.execute();
p.setInt( 1, 5 );
p.setInt( 2, 5 );
p.execute();
}
System.out.println("done");
try ( Statement statement = con.createStatement() ) {
statement.execute( "SELECT * FROM t" );
}
}


Expand Down

0 comments on commit b2848db

Please sign in to comment.