de.esprit.appsuite.database.dbase

## Class StatementCache

- java.lang.Object
- - de.esprit.appsuite.database.dbase.StatementCache

-     public class StatementCache
      extends java.lang.Object

  This cache stores prepared statements of various DBObjects. It allows to refetch a prepared statement based on a particular set of values which are `DBObject-type`, `connection` and `database-action`.
  Author:
    Rainer Buesch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StatementCache()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Clears all PreparedStatements in the cache, which forces them to be recreated if needed.
    `void` | `dumpContent(java.io.PrintStream ps)` Dumps the content of the statement cache to the given PrintStream.
    `java.sql.PreparedStatement` | `get(java.lang.Class dboClass, java.sql.Connection dbConn, DBAction action)` Refetches the requested PreparedStatement from the cache.
    `void` | `put(java.lang.Class dboClass, java.sql.Connection dbConn, DBAction action, java.sql.PreparedStatement stmt)` Stores the given PreparedStatement in the cache based on the given parameters.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### StatementCache

          public StatementCache()

  - ### Method Detail

    - #### get

          public java.sql.PreparedStatement get(java.lang.Class dboClass,
                                       java.sql.Connection dbConn,
                                       DBAction action)

      Refetches the requested PreparedStatement from the cache.
      Returns:
        the PreparedStatement that was stored for the given parameters, null if none could be found.

    - #### put

          public void put(java.lang.Class dboClass,
                 java.sql.Connection dbConn,
                 DBAction action,
                 java.sql.PreparedStatement stmt)

      Stores the given PreparedStatement in the cache based on the given parameters.

    - #### clear

          public void clear()

      Clears all PreparedStatements in the cache, which forces them to be recreated if needed.

    - #### dumpContent

          public void dumpContent(java.io.PrintStream ps)

      Dumps the content of the statement cache to the given PrintStream.

Copyright © 2014 EsprIT-Systems. All Rights Reserved.