Class StatementCache


  • public class StatementCache
    extends Object
    This class is an LRU cache for already parsed SQL statement executors. It stores itself in the storage as a resource. It also acts an an entry point for the SQL parser.
    Author:
    Luigi Dell'Aquila (luigi.dellaquila-(at)-gmail.com)
    • Constructor Detail

      • StatementCache

        public StatementCache​(Database db,
                              int size)
        Parameters:
        size - the size of the cache
    • Method Detail

      • get

        public Statement get​(String statement)
        Parameters:
        statement - an SQL statement
        Returns:
        the corresponding executor, taking it from the internal cache, if it exists
      • throwParsingException

        protected static void throwParsingException​(ParseException e,
                                                    String statement)
      • throwParsingException

        protected static void throwParsingException​(TokenMgrError e,
                                                    String statement)
      • contains

        public boolean contains​(String statement)
      • clear

        public void clear()