iartiukhov commented on code in PR #7122:
URL: https://github.com/apache/ignite-3/pull/7122#discussion_r2642353873


##########
examples/java/src/main/java/org/apache/ignite/example/table/RecordViewPojoExample.java:
##########
@@ -42,81 +39,73 @@ public static void main(String[] args) throws Exception {
         //
         
//--------------------------------------------------------------------------------------
 
-        try (
-                Connection conn = 
DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1:10800/");
-                Statement stmt = conn.createStatement()
-        ) {
-            stmt.executeUpdate(
-                    "CREATE TABLE accounts ("
-                            + "accountNumber INT PRIMARY KEY,"
-                            + "firstName     VARCHAR,"
-                            + "lastName      VARCHAR,"
-                            + "balance       DOUBLE)"
-            );
-        }
-
-        
//--------------------------------------------------------------------------------------
-        //
-        // Creating a client to connect to the cluster.
-        //
-        
//--------------------------------------------------------------------------------------
-
-        System.out.println("\nConnecting to server...");
-
         try (IgniteClient client = IgniteClient.builder()
                 .addresses("127.0.0.1:10800")
                 .build()
         ) {
-            
//--------------------------------------------------------------------------------------
-            //
-            // Creating a record view for the 'accounts' table.
-            //
-            
//--------------------------------------------------------------------------------------
-
-            RecordView<Account> accounts = client.tables()
-                    .table("accounts")
-                    .recordView(Account.class);
-
-            
//--------------------------------------------------------------------------------------
-            //
-            // Performing the 'insert' operation.
-            //
-            
//--------------------------------------------------------------------------------------
-
-            System.out.println("\nInserting a record into the 'accounts' 
table...");
-
-            Account newAccount = new Account(
-                    123456,
-                    "Val",
-                    "Kulichenko",
-                    100.00d
-            );
-
-            accounts.insert(null, newAccount);
-
-            
//--------------------------------------------------------------------------------------
-            //
-            // Performing the 'get' operation.
-            //
-            
//--------------------------------------------------------------------------------------
-
-            System.out.println("\nRetrieving a record using RecordView 
API...");
-
-            Account account = accounts.get(null, new Account(123456));
-
-            System.out.println(
-                    "\nRetrieved record:\n"
-                        + "    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");
+            try {

Review Comment:
   Please do not change unrelated examples. This example should be reverted. If 
you want to overcome the broken compatibility issue 
(https://issues.apache.org/jira/browse/IGNITE-27280) then please use the latest 
Ignite 3 build from `main`.



##########
examples/java/src/main/java/org/apache/ignite/example/table/KeyValueViewPojoExample.java:
##########
@@ -42,82 +39,75 @@ public static void main(String[] args) throws Exception {
         //
         
//--------------------------------------------------------------------------------------
 
-        try (
-                Connection conn = 
DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1:10800/");
-                Statement stmt = conn.createStatement()
-        ) {
-            stmt.executeUpdate(
-                    "CREATE TABLE accounts ("
-                            + "accountNumber INT PRIMARY KEY,"
-                            + "firstName     VARCHAR,"
-                            + "lastName      VARCHAR,"
-                            + "balance       DOUBLE)"
-            );
-        }
-
-        
//--------------------------------------------------------------------------------------
-        //
-        // Creating a client to connect to the cluster.
-        //
-        
//--------------------------------------------------------------------------------------
-
-        System.out.println("\nConnecting to server...");
-
         try (IgniteClient client = IgniteClient.builder()
                 .addresses("127.0.0.1:10800")
                 .build()
         ) {
-            
//--------------------------------------------------------------------------------------
-            //
-            // Creating a key-value view for the 'accounts' table.
-            //
-            
//--------------------------------------------------------------------------------------
-
-            KeyValueView<AccountKey, Account> kvView = client.tables()
-                    .table("accounts")
-                    .keyValueView(AccountKey.class, Account.class);
-
-            
//--------------------------------------------------------------------------------------
-            //
-            // Performing the 'put' operation.
-            //
-            
//--------------------------------------------------------------------------------------
-
-            System.out.println("\nInserting a key-value pair into the 
'accounts' table...");
-
-            AccountKey key = new AccountKey(123456);
-
-            Account value = new Account(
-                    "Val",
-                    "Kulichenko",
-                    100.00d
-            );
-
-            kvView.put(null, key, value);
-
-            
//--------------------------------------------------------------------------------------
-            //
-            // Performing the 'get' operation.
-            //
-            
//--------------------------------------------------------------------------------------
-
-            System.out.println("\nRetrieving a value using KeyValueView 
API...");
-
-            value = kvView.get(null, key);
-
-            System.out.println(
-                    "\nRetrieved value:\n"
-                        + "    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");
+            try {

Review Comment:
   Please do not change unrelated examples. This example should be reverted. If 
you want to overcome the broken compatibility issue 
(https://issues.apache.org/jira/browse/IGNITE-27280) then please use the latest 
Ignite 3 build from `main`.



##########
examples/java/src/main/java/org/apache/ignite/example/table/KeyValueViewExample.java:
##########
@@ -43,80 +40,73 @@ public static void main(String[] args) throws Exception {
         //
         
//--------------------------------------------------------------------------------------
 
-        try (
-                Connection conn = 
DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1:10800/");
-                Statement stmt = conn.createStatement()
-        ) {
-            stmt.executeUpdate(
-                    "CREATE TABLE accounts ("
-                            + "accountNumber INT PRIMARY KEY,"
-                            + "firstName     VARCHAR,"
-                            + "lastName      VARCHAR,"
-                            + "balance       DOUBLE)"
-            );
-        }
-
-        
//--------------------------------------------------------------------------------------
-        //
-        // Creating a client to connect to the cluster.
-        //
-        
//--------------------------------------------------------------------------------------
-
-        System.out.println("\nConnecting to server...");
-
         try (IgniteClient client = IgniteClient.builder()
                 .addresses("127.0.0.1:10800")
                 .build()
         ) {
-            
//--------------------------------------------------------------------------------------
-            //
-            // Creating a key-value view for the 'accounts' table.
-            //
-            
//--------------------------------------------------------------------------------------
-
-            KeyValueView<Tuple, Tuple> kvView = 
client.tables().table("accounts").keyValueView();
-
-            
//--------------------------------------------------------------------------------------
-            //
-            // Performing the 'put' operation.
-            //
-            
//--------------------------------------------------------------------------------------
-
-            System.out.println("\nInserting a key-value pair into the 
'accounts' table...");
-
-            Tuple key = Tuple.create()
-                    .set("accountNumber", 123456);
-
-            Tuple value = Tuple.create()
-                    .set("firstName", "Val")
-                    .set("lastName", "Kulichenko")
-                    .set("balance", 100.00d);
-
-            kvView.put(null, key, value);
-
-            
//--------------------------------------------------------------------------------------
-            //
-            // Performing the 'get' operation.
-            //
-            
//--------------------------------------------------------------------------------------
-
-            System.out.println("\nRetrieving a value using KeyValueView 
API...");
-
-            value = kvView.get(null, key);
-
-            System.out.println(
-                    "\nRetrieved value:\n"
-                            + "    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");
+            try {

Review Comment:
   Please do not change unrelated examples. This example should be reverted. If 
you want to overcome the broken compatibility issue 
(https://issues.apache.org/jira/browse/IGNITE-27280) then please use the latest 
Ignite 3 build from `main`.



##########
examples/java/src/main/java/org/apache/ignite/example/table/RecordViewExample.java:
##########
@@ -43,80 +40,72 @@ public static void main(String[] args) throws Exception {
         //
         
//--------------------------------------------------------------------------------------
 
-        try (
-                Connection conn = 
DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1:10800/");
-                Statement stmt = conn.createStatement()
-        ) {
-            stmt.executeUpdate(
-                    "CREATE TABLE accounts ("
-                            + "accountNumber INT PRIMARY KEY,"
-                            + "firstName     VARCHAR,"
-                            + "lastName      VARCHAR,"
-                            + "balance       DOUBLE)"
-            );
-        }
-
-        
//--------------------------------------------------------------------------------------
-        //
-        // Creating a client to connect to the cluster.
-        //
-        
//--------------------------------------------------------------------------------------
-
-        System.out.println("\nConnecting to server...");
-
         try (IgniteClient client = IgniteClient.builder()
                 .addresses("127.0.0.1:10800")
                 .build()
         ) {
-            
//--------------------------------------------------------------------------------------
-            //
-            // Creating a record view for the 'accounts' table.
-            //
-            
//--------------------------------------------------------------------------------------
-
-            RecordView<Tuple> accounts = 
client.tables().table("accounts").recordView();
-
-            
//--------------------------------------------------------------------------------------
-            //
-            // Performing the 'insert' operation.
-            //
-            
//--------------------------------------------------------------------------------------
-
-            System.out.println("\nInserting a record into the 'accounts' 
table...");
-
-            Tuple newAccountTuple = Tuple.create()
-                    .set("accountNumber", 123456)
-                    .set("firstName", "Val")
-                    .set("lastName", "Kulichenko")
-                    .set("balance", 100.00d);
-
-            accounts.insert(null, newAccountTuple);
-
-            
//--------------------------------------------------------------------------------------
-            //
-            // Performing the 'get' operation.
-            //
-            
//--------------------------------------------------------------------------------------
-
-            System.out.println("\nRetrieving a record using RecordView 
API...");
-
-            Tuple accountNumberTuple = Tuple.create().set("accountNumber", 
123456);
-
-            Tuple accountTuple = accounts.get(null, accountNumberTuple);
-
-            System.out.println(
-                    "\nRetrieved record:\n"
-                            + "    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");
+            try {

Review Comment:
   Please do not change unrelated examples. This example should be reverted. If 
you want to overcome the broken compatibility issue 
(https://issues.apache.org/jira/browse/IGNITE-27280) then please use the latest 
Ignite 3 build from `main`.



-- 
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]

Reply via email to