Package org.apache.derbyTesting.system.optimizer.query

Examples of org.apache.derbyTesting.system.optimizer.query.GenericQuery


      if (verbose)
        System.out.println(" List of query scenarios to run: "+QueryList.getQList().size());
      for(int i=0;i<QueryList.getQList().size();i++){
        if (verbose)
          System.out.println("\n______________________________________________________________________\n");
        GenericQuery gq=(GenericQuery)QueryList.getQList().get(i);
        if (verbose)
          System.out.println("*** Running query: "+gq.getDescription()+" ***");
        conn=null; //conn.close() throws "Invalid transaction state" exception
        conn = DriverManager.getConnection(jdbcurl);
        gq.setConnection(conn);
        gq.executeQueries(false,verbose); //using regular STATEMENTS
        conn.close();
        conn=null; //conn.close() throws "Invalid transaction state" exception
        conn = DriverManager.getConnection(jdbcurl);
        gq.setConnection(conn);
        gq.executeQueries(true,verbose); //using prepared STATEMENTS
       
      }
    } catch (ClassNotFoundException cne) {
      System.out.println("Class not found Exception: " + cne.getMessage());
    } catch (SQLException sqe) {
View Full Code Here


  }
  private static void printResults(){
    System.out.println("\n\n========================= R E S U L T S =========================\n");
      for(int i=0;i<QueryList.getQList().size();i++){
      System.out.println("\n________________________________________________________________________________________________");
      GenericQuery gq=(GenericQuery)QueryList.getQList().get(i);
      if (gq.getPrepStmtRunResults().size()==0){
        System.out.println("Queries didn't run");
        System.exit(0);
      }
      else{
      System.out.println("Timings for Query type: "+gq.getDescription()+"\n");
      System.out.println("QueryName\tUsing PreparedStatment\tUsing Statement\tRows Expected");
      System.out.println("------------------------------------------------------------------------------");
      System.out.println("Query size: " + gq.getQueries().size());
      for(int k=0;k<gq.getQueries().size();k++){
        String queryName="QUERY # "+(k+1);
        String[] prepStmtTimes=(String [])gq.getPrepStmtRunResults().get(k);
        String [] stmtTimes=(String [])gq.getStmtRunResults().get(k);
        for(int j=0; j<StaticValues.ITER;j++){
          System.out.println(queryName+"\t"+prepStmtTimes[j]+"\t\t"+stmtTimes[j]+"\t"+gq.getRowsExpected(k));
        }
     
        System.out.println("*************************************************************************");
       
      }
 
View Full Code Here

        System.out.println(" List of query scenarios to run: "+QueryList.getQList().size());
            System.out.println("Starting tests ...");
      for(int i=0;i<QueryList.getQList().size();i++){
        if (verbose)
          System.out.println("\n______________________________________________________________________\n");
        GenericQuery gq=(GenericQuery)QueryList.getQList().get(i);
        if (verbose)
          System.out.println("*** Running query: "+gq.getDescription()+" ***");
        conn=null; //conn.close() throws "Invalid transaction state" exception
        conn = DriverManager.getConnection(jdbcurl);
        gq.setConnection(conn);
        gq.executeQueries(false,verbose); //using regular STATEMENTS
        conn.close();
        conn=null; //conn.close() throws "Invalid transaction state" exception
        conn = DriverManager.getConnection(jdbcurl);
        gq.setConnection(conn);
        gq.executeQueries(true,verbose); //using prepared STATEMENTS
       
      }
    } catch (ClassNotFoundException cne) {
      System.out.println("Class not found Exception: " + cne.getMessage());
    } catch (SQLException sqe) {
View Full Code Here

  }
  private static void printResults(){
    System.out.println("\n\n========================= R E S U L T S =========================\n");
      for(int i=0;i<QueryList.getQList().size();i++){
      System.out.println("\n________________________________________________________________________________________________");
      GenericQuery gq=(GenericQuery)QueryList.getQList().get(i);
      if (gq.getPrepStmtRunResults().size()==0){
        System.out.println("Queries didn't run");
        System.exit(0);
      }
      else{
      System.out.println("Timings for Query type: "+gq.getDescription()+"\n");
      System.out.println("QueryName\tUsing PreparedStatment\tUsing Statement\tRows Expected");
      System.out.println("------------------------------------------------------------------------------");
      System.out.println("Query size: " + gq.getQueries().size());
      for(int k=0;k<gq.getQueries().size();k++){
        String queryName="QUERY # "+(k+1);
        String[] prepStmtTimes=(String [])gq.getPrepStmtRunResults().get(k);
        String [] stmtTimes=(String [])gq.getStmtRunResults().get(k);
        for(int j=0; j<StaticValues.ITER;j++){
          System.out.println(queryName+"\t"+prepStmtTimes[j]+"\t\t"+stmtTimes[j]+"\t"+gq.getRowsExpected(k));
        }
     
        System.out.println("*************************************************************************");
       
      }
 
View Full Code Here

TOP

Related Classes of org.apache.derbyTesting.system.optimizer.query.GenericQuery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.