Class Installer

All Implemented Interfaces:
AutoCloseable

final class Installer extends ScriptRunner
Executes the installation scripts for the "metadata" schema in the "SpatialMetadata" database.
Since:
0.8
Version:
1.0
  • Field Details

    • enumTypes

      private final String[] enumTypes
      List of enumeration types to replace by VARCHAR on implementations that do not support ENUM type.
  • Constructor Details

    • Installer

      Installer(Connection connection) throws SQLException
      Creates a new installer for the metadata database.
      Parameters:
      connection - connection to the metadata database.
      Throws:
      SQLException - if an error occurred while executing a SQL statement.
  • Method Details

    • run

      public void run() throws IOException, SQLException
      Runs the installation scripts.
      Throws:
      IOException
      SQLException
    • execute

      protected int execute(StringBuilder sql) throws SQLException, IOException
      Invoked for each line of the SQL installation script to execute. If the database does not support enumerations, replaces enumeration columns by VARCHAR.
      Overrides:
      execute in class ScriptRunner
      Parameters:
      sql - the SQL statement to execute.
      Returns:
      the number of rows added or modified as a result of the statement execution.
      Throws:
      SQLException - if an error occurred while executing the SQL statement.
      IOException - if an I/O operation was required and failed.