public class HSQL extends DatabaseType
_connection, _createIndexes, VERSION_TABLE_NAME
Modifier | Constructor and Description |
---|---|
protected |
HSQL()
Only this package (DatabaseFactory) can instantiate.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
_areForeignKeysIndexed()
Returns true if foreign keys are automatically indexed.
|
protected boolean |
_arePrimaryKeysIndexed()
Returns true if primary keys are automatically indexed.
|
protected static void |
_deletePortFile(java.lang.String dbName)
Delete the port file for a database.
|
protected void |
_executeSQL(java.lang.String sqlStr,
java.sql.Connection connection)
Execute an SQL statement for a Connection.
|
protected java.sql.Connection |
_getConnection(java.lang.String jdbcURL)
Get a connection to the database.
|
protected java.sql.Connection |
_getConnection(java.lang.String dbURL,
java.lang.String dbPort,
java.lang.String databaseName,
java.lang.String userName,
java.lang.String passwd)
Get a connection to the database.
|
protected java.lang.String |
_getDriverName()
Get the driver class name.
|
protected java.lang.String |
_getJDBCUrl(java.lang.String hostName,
java.lang.String port,
java.lang.String databaseName)
Get a JDBC URL.
|
protected java.lang.String |
_getPort(java.lang.String dbPort,
java.lang.String dbName,
java.lang.String hostName)
Get the port for a database name.
|
protected java.lang.String |
_getTypeString(Column column)
Get the SQL string of a column type.
|
protected boolean |
_hasCatalog()
Returns true if database uses a catalog.
|
protected boolean |
_hasGeneratedKeys()
Returns true if database supports auto-generated keys in its prepared
statements.
|
protected boolean |
_isTableCached()
Returns true if table is cached.
|
protected boolean |
_needCapitalColumnNames()
Returns true if column names should be capitalized.
|
protected boolean |
_needCapitalTableNames()
Returns true if table names should be capitalized.
|
static void |
checkpointAllServers()
Checkpoint any servers to compact their size.
|
void |
disconnect()
Close a JDBC connection.
|
java.lang.String |
getColumnAlterStr()
Get the string used in SQL statements to modify the
data type of a column.
|
java.lang.String |
getColumnName(java.lang.String columnName)
Adjust the name of a column.
|
java.lang.String |
getDefaultTimeStr()
Get a string representing the default time.
|
java.lang.String |
getFalseValue()
Get a string representation of the false value for a boolean column.
|
java.lang.String |
getName()
Get the name of the type.
|
java.lang.String |
getPrimaryFileExtension()
Get the primary file extension of the database.
|
java.lang.String |
getTrueValue()
Get a string representation of the true value for a boolean column.
|
boolean |
needAbsolutePathForName()
Returns true if database name should be an absolute path in the
file system.
|
boolean |
needHostForConnect()
Returns true if need host name for connect.
|
boolean |
needPasswordForConnect()
Returns true if need password for connect.
|
boolean |
needUserForConnect()
Returns true if need user name for connect.
|
void |
renameColumn(java.lang.String oldName,
Column newColumn,
java.lang.String tableName)
Rename a column.
|
void |
setColumnNotNull(Column column,
java.lang.String tableName)
Set not null constraint to a column.
|
void |
setColumnNull(Column column,
java.lang.String tableName)
Change a column to allow null values.
|
static void |
setForkServers(boolean fork)
Set whether HSQL servers are run in a separate process.
|
static void |
shutdownServers()
Stop any running servers.
|
_combineHostAndPort, _connectInitialize, _executeSQL, _getCreateTableSuffix, _isAutoIncResultReferencedByName, _isIdentifierTooLong, _needIdentityForAutoInc, _needSequencesForAutoInc, addMinorVersion, changeColumnType, commit, connect, copyColumn, createColumn, createColumn, createColumn, createIndex, createIndex, createTables, createTables, createVersionTable, deleteColumn, getColumnDefinition, getColumnDefinition, getColumnNames, getColumnSize, getConnection, getMajorVersion, getMinorVersion, getPrepStatement, getSQLDelete, getSQLInsert, getSQLInsert, getSQLSelect, getSQLSelect, getSQLUpdate, getStatement, getTableName, getVersionString, hasNewerSchema, hasOlderSchema, insert, procedureExists, rollback, setAutoCommit, tableExists, tableExists, updateMinorVersion
protected HSQL()
public void disconnect() throws java.sql.SQLException
disconnect
in class DatabaseType
java.sql.SQLException
protected java.lang.String _getPort(java.lang.String dbPort, java.lang.String dbName, java.lang.String hostName) throws java.io.IOException
_getPort
in class DatabaseType
java.io.IOException
public java.lang.String getColumnAlterStr()
getColumnAlterStr
in class DatabaseType
public java.lang.String getColumnName(java.lang.String columnName)
getColumnName
in class DatabaseType
public java.lang.String getDefaultTimeStr()
getDefaultTimeStr
in class DatabaseType
public java.lang.String getFalseValue()
getFalseValue
in class DatabaseType
public java.lang.String getName()
getName
in class DatabaseType
public java.lang.String getPrimaryFileExtension()
getPrimaryFileExtension
in class DatabaseType
public java.lang.String getTrueValue()
getTrueValue
in class DatabaseType
public boolean needAbsolutePathForName()
needAbsolutePathForName
in class DatabaseType
public boolean needHostForConnect()
needHostForConnect
in class DatabaseType
public boolean needPasswordForConnect()
needPasswordForConnect
in class DatabaseType
public boolean needUserForConnect()
needUserForConnect
in class DatabaseType
public void renameColumn(java.lang.String oldName, Column newColumn, java.lang.String tableName) throws java.sql.SQLException
renameColumn
in class DatabaseType
java.sql.SQLException
public void setColumnNull(Column column, java.lang.String tableName) throws java.sql.SQLException
setColumnNull
in class DatabaseType
java.sql.SQLException
public void setColumnNotNull(Column column, java.lang.String tableName) throws java.sql.SQLException
setColumnNotNull
in class DatabaseType
java.sql.SQLException
public static void setForkServers(boolean fork)
public static void shutdownServers()
protected boolean _areForeignKeysIndexed()
_areForeignKeysIndexed
in class DatabaseType
protected boolean _arePrimaryKeysIndexed()
_arePrimaryKeysIndexed
in class DatabaseType
protected java.lang.String _getDriverName()
_getDriverName
in class DatabaseType
protected java.lang.String _getJDBCUrl(java.lang.String hostName, java.lang.String port, java.lang.String databaseName) throws java.sql.SQLException
_getJDBCUrl
in class DatabaseType
java.sql.SQLException
protected java.lang.String _getTypeString(Column column)
_getTypeString
in class DatabaseType
protected boolean _hasCatalog()
_hasCatalog
in class DatabaseType
protected boolean _hasGeneratedKeys()
_hasGeneratedKeys
in class DatabaseType
protected boolean _isTableCached()
_isTableCached
in class DatabaseType
protected boolean _needCapitalColumnNames()
_needCapitalColumnNames
in class DatabaseType
protected boolean _needCapitalTableNames()
_needCapitalTableNames
in class DatabaseType
protected java.sql.Connection _getConnection(java.lang.String jdbcURL) throws java.sql.SQLException
_getConnection
in class DatabaseType
java.sql.SQLException
protected java.sql.Connection _getConnection(java.lang.String dbURL, java.lang.String dbPort, java.lang.String databaseName, java.lang.String userName, java.lang.String passwd) throws java.sql.SQLException
_getConnection
in class DatabaseType
java.sql.SQLException
public static void checkpointAllServers()
protected void _executeSQL(java.lang.String sqlStr, java.sql.Connection connection) throws java.sql.SQLException
java.sql.SQLException
protected static void _deletePortFile(java.lang.String dbName)