@@ -0,0 +1,1445 @@
+package test.template.cases.demo;%0D%0Aimport java.sql.Connection;%0D%0A%0D%0Aimport org.testng.annotations.Test;%0D%0A%0D%0Aimport test.template.cases.base.BaseTestCase;%0D%0Aimport test.template.utils.DBRestoreUtils;%0D%0Aimport test.template.utils.DBUtils;%0D%0A%0D%0Apublic class DBUtilsTest extends BaseTestCase %7B%0D%0A%0D%0A%09@Test%0D%0A%09public void test() throws Exception %7B%0D%0A%09%09Connection cn = DBUtils.getConnection(%22oracle_%22);%0D%0A//%09%09System.out.println(DBUtils.update(cn, %22INSERT INTO mytable1(id) VALUES(9)%22));%0D%0A//%09%09System.out.println(DBUtils.query(cn, %22SELECT * FROM mytable1%22));%0D%0A%09%09%0D%0A%09%09System.out.println(DBUtils.query(cn, %22SELECT * FROM TABLE2 WHERE cdate=to_date('2017-06-01', 'YYYY-MM-DD')%22));%0D%0A%09%09System.out.println(DBUtils.query(cn, %22SELECT * FROM TABLE2 WHERE cdate=TIMESTAMP '2017-06-01 00:00:00.0'%22));%0D%0A%09%09System.out.println(DBUtils.query(cn, %22SELECT * FROM TABLE2 WHERE cdate=DATE '2017-06-01'%22));%0D%0A%0D%0A%09%09DBUtils.update(cn, %22UPDATE TABLE2 SET cdate=TIMESTAMP '2017-06-02 00:00:00.0', ctime=TIMESTAMP '2017-06-02 00:00:00.0' WHERE id=1%22);%0D%0A//%09%09DBUtils.update(cn, %22INSERT INTO TABLE2(ID, CDATE, CTIME) VALUES(2, to_date('2017-06-01', 'YYYY-MM-DD'), to_date('2017-06-01', 'YYYY-MM-DD'))%22);%0D%0A%09%09%0D%0A%09%09String backupId = DBRestoreUtils.backup(cn, %22SELECT * FROM TABLE2 WHERE ID=1%22);%0D%0A%09%09DBUtils.update(cn, %22UPDATE TABLE2 SET cdate=TIMESTAMP '2017-06-02 00:00:00.0', ctime=TIMESTAMP '2017-06-08 00:00:00.0' WHERE id=1%22);%0D%0A%0D%0A%09%09DBRestoreUtils.restore(cn, backupId);%0D%0A%0D%0A%09%09cn.close();%0D%0A%09%7D%0D%0A%0D%0A%7D%0D%0A

Add DBUtilsTest