private String[] fieldNames;
private ResultSetMetaData metadata;
public void open(Connection con, String tableName, String geomFieldName)
throws DriverException {
VectorialDBAdapter adapter = new VectorialDBAdapter();
PostGisDriver driver = new PostGisDriver();
DBLayerDefinition layerDef = new DBLayerDefinition();
layerDef.setFieldGeometry(geomFieldName);
try {
layerDef.setFieldID(getPKNames(con, tableName));
layerDef.setFieldNames(getFieldNames(con, "select * from "
+ tableName + " where false"));
} catch (SQLException e) {
throw new DriverException(e);
}
layerDef.setTableName(tableName);
layerDef.setWhereClause("");
layerDef.setWorkingArea(null);
driver.setData(con, layerDef);
adapter.setDriver(driver);
adapter.start();
setDriver(driver);
super.open(adapter);
try {
metadata = con.createStatement().executeQuery("select * from " + tableName + " where false").getMetaData();