Class WebSession

java.lang.Object
org.h2.server.web.WebSession

class WebSession extends Object
The web session keeps all data of a user session. This class is used by the H2 Console.
  • Field Details

    • MAX_HISTORY

      private static final int MAX_HISTORY
      See Also:
    • lastAccess

      long lastAccess
      The last time this client sent a request.
    • map

      final HashMap<String,Object> map
      The session attribute map.
    • locale

      Locale locale
      The current locale.
    • executingStatement

      Statement executingStatement
      The currently executing statement.
    • result

      ResultSet result
      The current updatable result set.
    • server

      private final WebServer server
    • commandHistory

      private final ArrayList<String> commandHistory
    • conn

      private Connection conn
    • meta

      private DatabaseMetaData meta
    • contents

      private DbContents contents
    • bnf

      private Bnf bnf
    • shutdownServerOnDisconnect

      private boolean shutdownServerOnDisconnect
  • Constructor Details

  • Method Details

    • put

      void put(String key, Object value)
      Put an attribute value in the map.
      Parameters:
      key - the key
      value - the new value
    • get

      Object get(String key)
      Get the value for the given key.
      Parameters:
      key - the key
      Returns:
      the value
    • remove

      Object remove(String key)
      Remove a session attribute from the map.
      Parameters:
      key - the key
      Returns:
      value that was associated with the key, or null
    • getBnf

      Bnf getBnf()
      Get the BNF object.
      Returns:
      the BNF object
    • loadBnf

      void loadBnf()
      Load the SQL grammar BNF.
    • getCommand

      String getCommand(int id)
      Get the SQL statement from history.
      Parameters:
      id - the history id
      Returns:
      the SQL statement
    • addCommand

      void addCommand(String sql)
      Add a SQL statement to the history.
      Parameters:
      sql - the SQL statement
    • getCommandHistory

      ArrayList<String> getCommandHistory()
      Get the list of SQL statements in the history.
      Returns:
      the commands
    • getInfo

      HashMap<String,Object> getInfo()
      Update session meta data information and get the information in a map.
      Returns:
      a map containing the session meta data
    • setConnection

      void setConnection(Connection conn) throws SQLException
      Throws:
      SQLException
    • getMetaData

      DatabaseMetaData getMetaData()
    • getConnection

      Connection getConnection()
    • getContents

      DbContents getContents()
    • setShutdownServerOnDisconnect

      void setShutdownServerOnDisconnect()
      Shutdown the server when disconnecting.
    • getShutdownServerOnDisconnect

      boolean getShutdownServerOnDisconnect()
    • close

      void close()
      Close the connection and stop the statement if one is currently executing.