Override JDBC4PreparedStatement to throw exception when calling addBatch method

This commit is contained in:
김선우
2025-08-24 09:35:29 +09:00
parent 346525e5f0
commit bf1473dc08
3 changed files with 6 additions and 3 deletions

View File

@@ -176,6 +176,11 @@ public final class JDBC4PreparedStatement extends JDBC4Statement implements Prep
// TODO
}
@Override
public void addBatch(String sql) throws SQLException {
throw new SQLException("addBatch(String) cannot be called on a PreparedStatement");
}
@Override
public void setCharacterStream(int parameterIndex, Reader reader, int length)
throws SQLException {}

View File

@@ -11,7 +11,6 @@ import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.locks.ReentrantLock;
import tech.turso.annotations.Nullable;
import tech.turso.annotations.SkipNullableCheck;
import tech.turso.core.TursoResultSet;
@@ -261,7 +260,6 @@ public class JDBC4Statement implements Statement {
int[] updateCounts = new int[batchCommands.size()];
List<String> failedCommands = new ArrayList<>();
int[] successfulCounts = new int[batchCommands.size()];
// Execute each command in the batch
for (int i = 0; i < batchCommands.size(); i++) {