Class BatchBuilder
java.lang.Object
me.hsgamer.hscore.database.client.sql.BatchBuilder
A builder for batch execution
-
Method Summary
Modifier and TypeMethodDescriptionAdd values to the batchAdd values to the batchstatic BatchBuilder
create
(Connection connection, String statement) Create a new builderint[]
execute()
Execute the batchint[]
Execute the batch but ignore the exception
-
Method Details
-
create
Create a new builder- Parameters:
connection
- the connectionstatement
- the statement- Returns:
- the builder
-
addValues
Add values to the batch- Parameters:
values
- the values- Returns:
- this builder for chaining
-
addValues
Add values to the batch- Parameters:
values
- the values- Returns:
- this builder for chaining
-
execute
Execute the batch- Returns:
- the result of the batch
- Throws:
SQLException
- if a SQL error occurs
-
executeSafe
public int[] executeSafe()Execute the batch but ignore the exception- Returns:
- the result of the batch
-