FileDocCategorySizeDatePackage
JDBCLogger.javaAPI DocExample1080Tue Nov 13 16:53:02 GMT 2001tuning.jdbc

JDBCLogger

public class JDBCLogger extends Object

Fields Summary
private static Hashtable
QueryTime
Constructors Summary
Methods Summary
public static voidendLogSqlNext(java.lang.Thread t, java.lang.String sql)

public static voidendLogSqlQuery(java.lang.Thread t, java.lang.String sql)

     long time = System.currentTimeMillis();
     time -= ((Long) QueryTime.get(t)).longValue();
     System.out.println("Time: " + time + " millis for SQL query " + sql);
     QueryTime.remove(t);
  
public static voidstartLogSqlNext(java.lang.Thread t, java.lang.String sql)

public static voidstartLogSqlQuery(java.lang.Thread t, java.lang.String sql)


        
  
     if (QueryTime.get(t) != null)
       System.out.println("WARNING: overwriting sql query log time for " + sql);
     QueryTime.put(t, new Long(System.currentTimeMillis()));