Class SQLTool


  • public class SQLTool
    extends java.lang.Object
    SQL Tools
    This class only provides static variables and methods
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void clearStatistics()  
      static double getAvgTime()
      Average of SQL times in milliseconds
      static long getCountTotal()
      Requests counter
      static SQLTool.Metrics getMetrics()
      Get the SQL metrics for the period
      static java.lang.String getSequenceName​(int dbvendor, java.lang.String table, java.lang.String col)  
      static java.lang.String getString​(java.sql.ResultSet rs, int type, int index)
      Get a String in a result
      static int getTopSize()  
      static java.util.List<SQLTool.TopSQL> getTopSQL()
      Get the top SQL long requests
      static double getTotalTime()
      Total of SQL times in milliseconds
      static void insertTopSQL​(int index, java.lang.String date, java.lang.String sql, long ms, java.lang.String logId)  
      static boolean rebuildSequence​(java.lang.String datasource, java.lang.String table)
      Rebuild sequence associated with an internal table
      static void setTopSize​(int size)  
      static void statistics​(java.lang.String sql, long begin, java.lang.String login)
      SQL statistics
      static void statistics​(java.lang.String sql, java.util.List<ObjectField> host, long begin, java.lang.String login)
      Manage SQL statistics (time average, long requests...)
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getString

        public static java.lang.String getString​(java.sql.ResultSet rs,
                                                 int type,
                                                 int index)
        Get a String in a result
      • setTopSize

        public static void setTopSize​(int size)
      • getTopSize

        public static int getTopSize()
      • getTopSQL

        public static java.util.List<SQLTool.TopSQL> getTopSQL()
        Get the top SQL long requests
      • getCountTotal

        public static long getCountTotal()
        Requests counter
      • getAvgTime

        public static double getAvgTime()
        Average of SQL times in milliseconds
      • getTotalTime

        public static double getTotalTime()
        Total of SQL times in milliseconds
      • getMetrics

        public static SQLTool.Metrics getMetrics()
        Get the SQL metrics for the period
      • statistics

        public static void statistics​(java.lang.String sql,
                                      long begin,
                                      java.lang.String login)
        SQL statistics
        Parameters:
        sql - Query
        begin - Start time (ms)
      • statistics

        public static void statistics​(java.lang.String sql,
                                      java.util.List<ObjectField> host,
                                      long begin,
                                      java.lang.String login)
        Manage SQL statistics (time average, long requests...)
        Parameters:
        sql - Query
        host - Host values to trace
        begin - Start time (ms)
      • insertTopSQL

        public static void insertTopSQL​(int index,
                                        java.lang.String date,
                                        java.lang.String sql,
                                        long ms,
                                        java.lang.String logId)
      • clearStatistics

        public static void clearStatistics()
      • getSequenceName

        public static java.lang.String getSequenceName​(int dbvendor,
                                                       java.lang.String table,
                                                       java.lang.String col)
      • rebuildSequence

        public static boolean rebuildSequence​(java.lang.String datasource,
                                              java.lang.String table)
        Rebuild sequence associated with an internal table
        Parameters:
        datasource - Datasource name
        table - Table name (with a row_id primary key)