To add a new, empty Informix Geodetic database table to which you can add spatial data later, first create a properties object with all required information.
Program: Create the properties object with the information required to create a table.
static Properties getProperties() {
Properties properties = new Properties();
// The basic database connection properties.
properties.put("driver", "com.informix.jdbc.IfxDriver");
properties.put("url", "jdbc:informix-sqli://localhost:9088/luciad:INFORMIXSERVER=localhost");
properties.put("user", "luciad");
properties.put("password", "luciad");
// The data of interest.
properties.put("table", "WORLD");
properties.put("spatialColumn", "GEOMETRY");
// The feature columns to be decoded.
properties.put("featureNames.0", "COUNTRY");
properties.put("featureNames.1", "CAPITAL");
properties.put("featureNames.2", "POP_1994");
// Optional display names.
properties.put("featureDisplayNames.0", "Country");
properties.put("featureDisplayNames.1", "Capital");
properties.put("featureDisplayNames.2", "Population");
// The index of the feature that can be used as primary key.
properties.put("primaryFeatureIndex", "0");
properties.put("SRID", "0");
// The regular SQL data types of the feature columns.
properties.put("featureDataTypes.0", "VARCHAR(30)");
properties.put("featureDataTypes.1", "VARCHAR(30)");
properties.put("featureDataTypes.2", "INTEGER");
// Careful with this option: it will drop the existing table (if any) when
// creating a new table (instead of failing with an SQL exception).
properties.put("dropBeforeCreatingTable", "false");
return properties;
}
Next, use this properties object to export an empty model, which creates the table.
Program: Create an empty Informix Geodetic table
TLcdInformixGeodeticModelEncoder encoder = new TLcdInformixGeodeticModelEncoder();
encoder.export(new TLcd2DBoundsIndexedModel(), getProperties());