Skip to content

Commit

Permalink
revise book example
Browse files Browse the repository at this point in the history
  • Loading branch information
t-horikawa committed Aug 18, 2023
1 parent b64ce15 commit ff576da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static void doInsert(String url) throws IOException, ServerException, Int
Placeholders.of("int_for_bar1", long.class),
Placeholders.of("double_for_bar2", double.class),
Placeholders.of("char_for_bar3", String.class)).get();
Transaction transaction = sqlClient.createTransaction().get();) {
Transaction transaction = sqlClient.createTransaction().get()) {

// insert first data into foo table
transaction.executeStatement(preparedStatement,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ public static void doSelect(String url) throws IOException, ServerException, Int
try (
Session session = SessionBuilder.connect(url).create();
SqlClient sqlClient = SqlClient.attach(session);
Transaction transaction = sqlClient.createTransaction().get();) {
Transaction transaction = sqlClient.createTransaction().get()) {

try (ResultSet resultSet = transaction.executeQuery("SELECT * FROM foo").get();) {
try (ResultSet resultSet = transaction.executeQuery("SELECT * FROM foo").get()) {
doSomeWorkUsingResultset(resultSet);
}
transaction.commit().get();
Expand Down

0 comments on commit ff576da

Please sign in to comment.