|
@@ -27,7 +27,7 @@ public class PhoenixDML {
|
|
|
|
|
|
public static void main(String[] args) throws ClassNotFoundException, SQLException {
|
|
|
|
|
|
- select("", "");
|
|
|
+ delete();
|
|
|
closeConnection();
|
|
|
}
|
|
|
|
|
@@ -52,14 +52,14 @@ public class PhoenixDML {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public Integer upsert(){
|
|
|
- String sql1="upsert into test_phoenix_api values(1,'test1')";
|
|
|
- String sql2="upsert into test_phoenix_api values(2,'test2')";
|
|
|
- String sql3="upsert into test_phoenix_api values(3,'test3')";
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ public static Integer upsert() throws SQLException {
|
|
|
+ String sql1="upsert into SAGA_LOG.test_phoenix_api values(1,'test1')";
|
|
|
+ String sql2="upsert into SAGA_LOG.test_phoenix_api values(2,'test2')";
|
|
|
+ String sql3="upsert into SAGA_LOG.test_phoenix_api values(3,'test3')";
|
|
|
+ statement.executeUpdate(sql1);
|
|
|
+ statement.executeUpdate(sql2);
|
|
|
+ statement.executeUpdate(sql3);
|
|
|
+ connection.commit();
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
@@ -69,7 +69,11 @@ public class PhoenixDML {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public Integer delete(){
|
|
|
+ public static Integer delete() throws SQLException {
|
|
|
+ String sql1="delete from SAGA_LOG.test_phoenix_api where mykey = 1";
|
|
|
+ statement.executeUpdate(sql1);
|
|
|
+ connection.commit();
|
|
|
+
|
|
|
return 0;
|
|
|
}
|
|
|
|