| A tool to set up a OSPI database. This tool was created so that OSPI
developers would only have to maintain a single set of xml documents to define
the OSPI database schema and data. Previously it was necessary to maintain
different scripts for each database we wanted to support.
DbLoader reads the generic types that are specified in tables.xml and
tries to map them to local types by querying the database metadata via methods
implemented by the JDBC driver. Fallback mappings can be supplied in
dbloader.xml for cases where the JDBC driver is not able to determine the
appropriate mapping. Such cases will be reported to standard out.
An xsl transformation is used to produce the DROP TABLE and CREATE TABLE
SQL statements. These statements can be altered by modifying tables.xsl
all table names should have lower case names
Generic data types (as defined in java.sql.Types) which may be specified
in tables.xml include:
BIT, TINYINT, SMALLINT, INTEGER, BIGINT, FLOAT, REAL, DOUBLE,
NUMERIC, DECIMAL, CHAR, VARCHAR, LONGVARCHAR, DATE, TIME, TIMESTAMP,
BINARY, VARBINARY, LONGVARBINARY, NULL, OTHER, JAVA_OBJECT, DISTINCT,
STRUCT, ARRAY, BLOB, CLOB, REF
WARNING: YOU MAY WANT TO MAKE A BACKUP OF YOUR DATABASE BEFORE RUNNING DbLoader
DbLoader will perform the following steps:
- Read configurable properties from dbloader.xml
- Get database connection from DbService
- Read tables.xml and issue corresponding DROP TABLE and CREATE TABLE SQL statements.
- Read data.xml and issue corresponding INSERT/UPDATE/DELETE SQL statements.
author: Ken Weiner, kweiner@interactivebusiness.com author: modified and adapted to OSPI by Luis F.C. Mendes - University of Delaware version: $Revision: 7153 $ See Also: java.sql.Types |