valepakh commented on code in PR #7738:
URL: https://github.com/apache/ignite-3/pull/7738#discussion_r2919183828
##########
examples/java/src/main/java/org/apache/ignite/example/table/RecordViewExample.java:
##########
@@ -109,15 +101,10 @@ public static void main(String[] args) throws Exception {
+ " Account Number: " +
accountTuple.intValue("accountNumber") + '\n'
+ " Owner: " +
accountTuple.stringValue("firstName") + " " +
accountTuple.stringValue("lastName") + '\n'
+ " Balance: $" +
accountTuple.doubleValue("balance"));
- } finally {
- System.out.println("\nDropping the table...");
-
- try (
- Connection conn =
DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1:10800/");
- Statement stmt = conn.createStatement()
- ) {
- stmt.executeUpdate("DROP TABLE accounts");
- }
+
+ System.out.println("Dropping the table...");
+
+ client.sql().execute("DROP TABLE accounts");
Review Comment:
If exists
##########
examples/java/src/main/java/org/apache/ignite/example/table/RecordViewPojoExample.java:
##########
@@ -109,15 +101,10 @@ public static void main(String[] args) throws Exception {
+ " Account Number: " + account.accountNumber + '\n'
+ " Owner: " + account.firstName + " " +
account.lastName + '\n'
+ " Balance: $" + account.balance);
- } finally {
- System.out.println("\nDropping the table...");
-
- try (
- Connection conn =
DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1:10800/");
- Statement stmt = conn.createStatement()
- ) {
- stmt.executeUpdate("DROP TABLE accounts");
- }
+
+ System.out.println("Dropping the table...");
+
+ client.sql().execute("DROP TABLE accounts");
Review Comment:
If exists
##########
examples/java/src/main/java/org/apache/ignite/example/table/KeyValueViewPojoExample.java:
##########
@@ -110,15 +102,10 @@ public static void main(String[] args) throws Exception {
+ " Account Number: " + key.accountNumber + '\n'
+ " Owner: " + value.firstName + " " +
value.lastName + '\n'
+ " Balance: $" + value.balance);
- } finally {
- System.out.println("\nDropping the table...");
-
- try (
- Connection conn =
DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1:10800/");
- Statement stmt = conn.createStatement()
- ) {
- stmt.executeUpdate("DROP TABLE accounts");
- }
+
+ System.out.println("Dropping the table...");
+
+ client.sql().execute("DROP TABLE accounts");
Review Comment:
If exists
##########
examples/java/src/main/java/org/apache/ignite/example/table/KeyValueViewExample.java:
##########
@@ -109,15 +101,10 @@ public static void main(String[] args) throws Exception {
+ " Account Number: " +
key.intValue("accountNumber") + '\n'
+ " Owner: " + value.stringValue("firstName") +
" " + value.stringValue("lastName") + '\n'
+ " Balance: $" + value.doubleValue("balance"));
- } finally {
- System.out.println("\nDropping the table...");
-
- try (
- Connection conn =
DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1:10800/");
- Statement stmt = conn.createStatement()
- ) {
- stmt.executeUpdate("DROP TABLE accounts");
- }
+
+ System.out.println("Dropping the table...");
+
+ client.sql().execute("DROP TABLE accounts");
Review Comment:
If exists
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]