Package org.apache.sis.metadata.sql
Class Installer
java.lang.Object
org.apache.sis.internal.metadata.sql.ScriptRunner
org.apache.sis.metadata.sql.Installer
- All Implemented Interfaces:
AutoCloseable
Executes the installation scripts for the "metadata" schema in the "SpatialMetadata" database.
- Since:
- 0.8
- Version:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String[]List of enumeration types to replace byVARCHARon implementations that do not supportENUMtype.Fields inherited from class org.apache.sis.internal.metadata.sql.ScriptRunner
identifierQuote, isCatalogSupported, isCommentSupported, isCreateLanguageRequired, isEnumTypeSupported, isGrantOnSchemaSupported, isGrantOnTableSupported, isSchemaSupported, PUBLIC -
Constructor Summary
ConstructorsConstructorDescriptionInstaller(Connection connection) Creates a new installer for the metadata database. -
Method Summary
Modifier and TypeMethodDescriptionprotected intexecute(StringBuilder sql) Invoked for each line of the SQL installation script to execute.voidrun()Runs the installation scripts.Methods inherited from class org.apache.sis.internal.metadata.sql.ScriptRunner
addReplacement, addStatementToSkip, close, editText, getConnection, getReplacement, isSupported, modifyReplacements, run, run, run, status, toString
-
Field Details
-
enumTypes
List of enumeration types to replace byVARCHARon implementations that do not supportENUMtype.
-
-
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
Runs the installation scripts.- Throws:
IOExceptionSQLException
-
execute
Invoked for each line of the SQL installation script to execute. If the database does not support enumerations, replaces enumeration columns byVARCHAR.- Overrides:
executein classScriptRunner- 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.
-