protected DataSource getDataSource() {
return dataSource;
}
public Metadata getMetadata() throws DriverException {
Metadata dataSourceMetadata = dataSource.getDataSourceMetadata();
String[] fieldNames = new String[dataSourceMetadata.getFieldCount()+1];
fieldNames[0] = "geom";
for (int i = 1; i < fieldNames.length; i++) {
fieldNames[i] = dataSourceMetadata.getFieldName(i-1);
}
int[] fieldTypes = new int[fieldNames.length];
fieldTypes[0] = PTTypes.GEOMETRY;
for (int i = 1; i < fieldTypes.length; i++) {
fieldTypes[i] = dataSourceMetadata.getFieldType(i-1);
}
return new DefaultMetadata(fieldTypes, fieldNames,
null, null);
}