1 21 22 package org.apache.derbyTesting.functionTests.tests.store; 23 24 import org.apache.derby.iapi.db.OnlineCompress; 25 26 import org.apache.derby.iapi.services.sanity.SanityManager; 27 28 import java.sql.CallableStatement ; 29 import java.sql.Connection ; 30 import java.sql.PreparedStatement ; 31 import java.sql.ResultSet ; 32 import java.sql.SQLException ; 33 import java.sql.Statement ; 34 35 import org.apache.derby.tools.ij; 36 37 38 public class oc_rec2 extends OnlineCompressTest 39 { 40 41 public oc_rec2() 42 { 43 } 44 45 53 private void test1( 54 Connection conn, 55 String test_name, 56 String table_name) 57 throws SQLException 58 { 59 beginTest(conn, test_name); 60 if (!checkConsistency(conn, "APP", table_name)) 61 { 62 logError("conistency check failed."); 63 } 64 createAndLoadTable(conn, false, table_name, 6000, 0); 67 if (!checkConsistency(conn, "APP", table_name)) 68 { 69 logError("conistency check failed."); 70 } 71 72 String table_name_2 = table_name + "_2"; 75 createAndLoadTable(conn, true, table_name_2, 2000, 0); 76 executeQuery(conn, "delete from " + table_name, true); 77 callCompress(conn, "APP", table_name, true, true, true, true); 78 79 endTest(conn, test_name); 80 } 81 82 public void testList(Connection conn) 83 throws SQLException 84 { 85 test1(conn, "test1", "TEST1"); 86 } 87 88 public static void main(String [] argv) 89 throws Throwable 90 { 91 oc_rec2 test = new oc_rec2(); 92 93 ij.getPropertyArg(argv); 94 Connection conn = ij.startJBMS(); 95 conn.setAutoCommit(false); 96 97 try 98 { 99 test.testList(conn); 100 } 101 catch (SQLException sqle) 102 { 103 org.apache.derby.tools.JDBCDisplayUtil.ShowSQLException( 104 System.out, sqle); 105 sqle.printStackTrace(System.out); 106 } 107 } 108 } 109 | Popular Tags |