Created
August 26, 2018 15:26
-
-
Save jerolba/e795ab6443cf36f00c8438c7d0708b28 to your computer and use it in GitHub Desktop.
JDBC, a register each time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
connection.setAutoCommit(true); | |
try (PreparedStatement pstmt = connection.prepareStatement(TripEntityInsert.INSERT)) { | |
Iterator<TripEntity> iterator = trips.iterator(); | |
while (iterator.hasNext()) { | |
tripInsert.setParameters(pstmt, iterator.next()); | |
pstmt.executeUpdate(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment