public class JdbcGtfsLoader extends Object
| Modifier and Type | Field and Description |
|---|---|
static long |
INSERT_BATCH_SIZE |
protected ZipFile |
zip |
| Constructor and Description |
|---|
JdbcGtfsLoader(String gtfsFilePath,
DataSource dataSource) |
| Modifier and Type | Method and Description |
|---|---|
static void |
copyFromFile(Connection connection,
File file,
String targetTableName)
Method that uses the PostgreSQL-specific copy from file command to load csv data into a table on the provided
connection.
|
FeedLoadResult |
loadTables() |
static String |
sanitize(String string,
SQLErrorStorage errorStorage)
Protect against SQL injection.
|
void |
setValueForField(Table table,
int fieldIndex,
int lineNumber,
Field field,
String string,
boolean postgresText,
String[] transformedStrings)
Set value for a field either as a prepared statement parameter or (if using postgres text-loading) in the
transformed strings array provided.
|
public static final long INSERT_BATCH_SIZE
protected ZipFile zip
public JdbcGtfsLoader(String gtfsFilePath, DataSource dataSource)
public FeedLoadResult loadTables()
public static void copyFromFile(Connection connection, File file, String targetTableName) throws IOException, SQLException
IOExceptionSQLExceptionpublic void setValueForField(Table table, int fieldIndex, int lineNumber, Field field, String string, boolean postgresText, String[] transformedStrings)
public static String sanitize(String string, SQLErrorStorage errorStorage)
Copyright © 2019. All rights reserved.