public class B3pOgcSqlWriter extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_GEOM_COLUMN |
static String |
POSTGRES_GLOBALGEOMETRY |
static List |
SUPPORTED_DIALECTS |
| Constructor and Description |
|---|
B3pOgcSqlWriter(Connection conn)
Creates a new instance of B3pOgcSqlWriter
|
B3pOgcSqlWriter(String url,
String user,
String password,
Driver driver) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
int |
getBatchValue()
Get the batch value for committing inserts
|
Connection |
getConnection()
Get the connection
|
void |
setBatchValue(int batchValue)
Set the batch value for committing inserts.
|
void |
setConnection(Connection connection)
Set the Connection
|
int[] |
write(org.locationtech.jts.jump.feature.FeatureCollection fc,
String tablename,
String geomColumn,
int dimension,
boolean createTable,
boolean attributeNamesToLowerCase)
Write features to the given table.
|
int[] |
write(org.locationtech.jts.jump.feature.FeatureCollection fc,
String tablename,
String geomColumn,
int dimension,
boolean createTable,
boolean attributeNamesToLowerCase,
String[] columnNamesToCheck)
Write features to the given table.
|
int[] |
write(org.locationtech.jts.jump.feature.FeatureCollection fc,
String tablename,
String geomColumn,
int dimension,
boolean createTable,
boolean attributeNamesToLowerCase,
String[] columnNamesToCheck,
String ignoreValue)
Write features to the given table.
|
int[] |
write(org.locationtech.jts.jump.feature.FeatureCollection fc,
String tablename,
String geomColumn,
String srid,
int dimension,
boolean createTable,
boolean attributeNamesToLowerCase)
Deprecated.
use function without SRID.
|
int[] |
write(org.locationtech.jts.jump.feature.FeatureCollection fc,
String tablename,
String geomColumn,
String srid,
int dimension,
boolean createTable,
boolean attributeNamesToLowerCase,
String[] columnNamesToCheck,
String ignoreValue)
Deprecated.
use function without SRID.
|
public static final String DEFAULT_GEOM_COLUMN
public static final String POSTGRES_GLOBALGEOMETRY
public static final List SUPPORTED_DIALECTS
public B3pOgcSqlWriter(Connection conn)
public B3pOgcSqlWriter(String url, String user, String password, Driver driver) throws SQLException
SQLExceptionpublic int[] write(org.locationtech.jts.jump.feature.FeatureCollection fc,
String tablename,
String geomColumn,
int dimension,
boolean createTable,
boolean attributeNamesToLowerCase)
throws SQLException,
Exception
fc - The collection of features.tablename - The tablename.geomColumn - The name of the geometry column. If null the attribute name of type geometry ikn the featureCollection is used.srid - The srid of the features. If srid is null the srid of the geometry in the featurecollection is used. If that is also 0 or null -1 is used.dimension - The dimension of the geometry in the feature. If 0 the dimension of the geometry is used. If still 0, 2 is used.createTabel - If true the function will try to create a table if the given tablename doesn't exists. It only supports PostGres/Postgis for creating geometry columns!attributeNamesToLowerCase - If true all attribute names will be cast to a lower case (recommended)SQLExceptionExceptionpublic int[] write(org.locationtech.jts.jump.feature.FeatureCollection fc,
String tablename,
String geomColumn,
int dimension,
boolean createTable,
boolean attributeNamesToLowerCase,
String[] columnNamesToCheck)
throws SQLException,
Exception
fc - The collection of features.tablename - The tablename.geomColumn - The name of the geometry column. If null the attribute name of type geometry ikn the featureCollection is used.srid - The srid of the features. If srid is null the srid of the geometry in the featurecollection is used. If that is also 0 or null -1 is used.dimension - The dimension of the geometry in the feature. If 0 the dimension of the geometry is used. If still 0, 2 is used.createTabel - If true the function will try to create a table if the given tablename doesn't exists. It only supports PostGres/Postgis for creating geometry columns!attributeNamesToLowerCase - If true all attribute names will be cast to a lower case (recommended)columns - to check on. If all attributes of a feature equals the columns of a record. The database record wil be updated with the feature (not inserted).SQLExceptionExceptionpublic int[] write(org.locationtech.jts.jump.feature.FeatureCollection fc,
String tablename,
String geomColumn,
int dimension,
boolean createTable,
boolean attributeNamesToLowerCase,
String[] columnNamesToCheck,
String ignoreValue)
throws SQLException,
Exception
fc - The collection of features.tablename - The tablename.geomColumn - The name of the geometry column. If null the attribute name of type geometry ikn the featureCollection is used.srid - The srid of the features. If srid is null the srid of the geometry in the featurecollection is used. If that is also 0 or null -1 is used.dimension - The dimension of the geometry in the feature. If 0 the dimension of the geometry is used. If still 0, 2 is used.createTabel - If true the function will try to create a table if the given tablename doesn't exists. It only supports PostGres/Postgis for creating geometry columns!attributeNamesToLowerCase - If true all attribute names will be cast to a lower case (recommended)columns - to check on. If all attributes of a feature equals the columns of a record. The database record wil be updated with the feature (not inserted).the - value to ignore. If a feature has that value don't include it in the update/insert.SQLExceptionException@Deprecated public int[] write(org.locationtech.jts.jump.feature.FeatureCollection fc, String tablename, String geomColumn, String srid, int dimension, boolean createTable, boolean attributeNamesToLowerCase) throws SQLException, Exception
fc - The collection of features.tablename - The tablename.geomColumn - The name of the geometry column. If null the attribute name of type geometry ikn the featureCollection is used.srid - The srid of the features. If srid is null the srid of the geometry in the featurecollection is used. If that is also 0 or null -1 is used.dimension - The dimension of the geometry in the feature. If 0 the dimension of the geometry is used. If still 0, 2 is used.createTabel - If true the function will try to create a table if the given tablename doesn't exists. It only supports PostGres/Postgis for creating geometry columns!attributeNamesToLowerCase - If true all attribute names will be cast to a lower case (recommended)SQLExceptionException@Deprecated public int[] write(org.locationtech.jts.jump.feature.FeatureCollection fc, String tablename, String geomColumn, String srid, int dimension, boolean createTable, boolean attributeNamesToLowerCase, String[] columnNamesToCheck, String ignoreValue) throws SQLException, Exception
fc - The collection of features.tablename - The tablename.geomColumn - The name of the geometry column. If null the attribute name of type geometry ikn the featureCollection is used.srid - The srid of the features. If srid is null the srid of the geometry in the featurecollection is used. If that is also 0 or null -1 is used.dimension - The dimension of the geometry in the feature. If 0 the dimension of the geometry is used. If still 0, 2 is used.createTabel - If true the function will try to create a table if the given tablename doesn't exists. It only supports PostGres/Postgis for creating geometry columns!attributeNamesToLowerCase - If true all attribute names will be cast to a lower case (recommended)columns - to check on. If all attributes of a feature equals the columns of a record. The database record wil be updated with the feature (not inserted).the - value to ignore. If a feature has that value don't include it in the update/insert.SQLExceptionExceptionpublic Connection getConnection()
public void setConnection(Connection connection)
connection - the connection used to access the databasepublic int getBatchValue()
public void setBatchValue(int batchValue)
batchValue - the new value. Default it is 20public void close()
throws SQLException
SQLExceptionCopyright © 2022 B3Partners B.V.. All rights reserved.