0

I have SQL statements as follows:

INSERT INTO PERSON(PERSON_ID, YEAR_OF_BIRTH) VALUES (1, 0);
UPDATE PERSON SET PERSON_ID=2;

How can I execute such type of SQL commands contained successively in a single file? I need to execute this SQL file in the Java code.

Thanks.

4

1 回答 1

1

根据文档sql_ _PreparedStatementexecuteBatch Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts

preparedStatement.executeBatch();
于 2013-09-09T12:12:40.753 回答