public class H2DatabaseDriver extends Object implements DatabaseDriver
| Modifier and Type | Class and Description |
|---|---|
static class |
H2DatabaseDriver.Type |
| Constructor and Description |
|---|
H2DatabaseDriver(H2DatabaseDriver.Type dbType,
String path,
boolean clearDB)
Constructor for the H2 database driver.
|
| Modifier and Type | Method and Description |
|---|---|
void |
bulkCopy(String path,
String delimiter,
boolean hasTruth,
PredicateInfo predicateInfo,
Partition partition)
Perform a bulk copy operation to load the file directly into the database.
|
void |
close()
Close out any outstanding connections and cleanup.
|
String |
finalizeCreateTable(com.healthmarketscience.sqlbuilder.CreateTableQuery createTable)
Gives the driver a chance to perform any final
manipulations to the CREATE TABLE statement.
|
Connection |
getConnection()
Returns a connection to the database.
|
String |
getDoubleTypeName()
Get the type name for a double type.
|
String |
getStringAggregate(String columnName,
String delimiter,
boolean distinct)
Get a string aggregating expression (one that
would appear in the SELECT clause of a grouping query.
|
String |
getSurrogateKeyColumnDefinition(String columnName)
Get the SQL definition for a primary, surrogate (auto-increment) key
for use in a CREATE TABLE statement.
|
String |
getTypeName(ConstantType type)
Get the type name for each argument type.
|
String |
getUpsert(String tableName,
String[] columns,
String[] keyColumns)
Get the SQL for an upsert (merge) on the specified table and columns.
|
boolean |
supportsBulkCopy()
Returns whether the underline database supports bulk copying operations.
|
public H2DatabaseDriver(H2DatabaseDriver.Type dbType, String path, boolean clearDB)
dbType - Type of database, either Disk or Memory.path - Path to database on disk, or name if type is Memory.clearDB - Whether to perform a DROP ALL on the database after connecting.public void close()
DatabaseDriverclose in interface DatabaseDriverpublic Connection getConnection()
DatabaseDrivergetConnection in interface DatabaseDriverpublic boolean supportsBulkCopy()
DatabaseDriversupportsBulkCopy in interface DatabaseDriverpublic void bulkCopy(String path, String delimiter, boolean hasTruth, PredicateInfo predicateInfo, Partition partition)
DatabaseDriverbulkCopy in interface DatabaseDriverpublic String getTypeName(ConstantType type)
DatabaseDrivergetTypeName in interface DatabaseDriverpublic String getSurrogateKeyColumnDefinition(String columnName)
DatabaseDrivergetSurrogateKeyColumnDefinition in interface DatabaseDriverpublic String getDoubleTypeName()
DatabaseDrivergetDoubleTypeName in interface DatabaseDriverpublic String getUpsert(String tableName, String[] columns, String[] keyColumns)
DatabaseDrivergetUpsert in interface DatabaseDriverpublic String finalizeCreateTable(com.healthmarketscience.sqlbuilder.CreateTableQuery createTable)
DatabaseDriverfinalizeCreateTable in interface DatabaseDriverpublic String getStringAggregate(String columnName, String delimiter, boolean distinct)
DatabaseDrivergetStringAggregate in interface DatabaseDriverCopyright © 2018 University of California, Santa Cruz. All rights reserved.