1 4 package org.ashkelon.db; 5 6 import java.sql.*; 7 import java.util.Date ; 8 9 12 public class IndexQueryTest 13 { 14 private static int FETCH_SIZE = 20; 15 16 public static void main(String [] args) throws Exception 17 { 18 String query = 19 " select " + 20 " m.id, m.qualifiedname, m.type, m.isstatic, " + 21 " m.isfinal, m.accessibility, m.modifier, meth.isabstract, " + 22 " meth.returntypeid, meth.returntypename, meth.returntypedimension, " + 23 " em.signature, d.summarydescription, d.since, d.deprecated " + 24 " from METHOD meth right outer join MEMBER m on meth.id=m.id " + 25 " left outer join EXECMEMBER em on em.id=m.id, DOC d " + 26 " where m.docid = d.id order by m.name"; 27 28 Connection conn = DBMgr.getInstance().getConnection(); 29 PreparedStatement p = conn.prepareStatement(query, 30 ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); 31 p.setFetchSize(FETCH_SIZE); 32 33 java.util.Date start = new java.util.Date (); 34 ResultSet rset = p.executeQuery(); 35 long millis = new Date ().getTime() - start.getTime(); 36 int secs = (int) (millis / 1000); 37 System.out.println("query execution time: "+secs+" seconds"); 38 40 rset.close(); 41 49 } 50 51 } 52 | Popular Tags |