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, updateMinorVersionprotected HSQL()
public void disconnect() throws java.sql.SQLException
disconnect in class DatabaseTypejava.sql.SQLExceptionprotected java.lang.String _getPort(java.lang.String dbPort, java.lang.String dbName, java.lang.String hostName) throws java.io.IOException
_getPort in class DatabaseTypejava.io.IOExceptionpublic java.lang.String getColumnAlterStr()
getColumnAlterStr in class DatabaseTypepublic java.lang.String getColumnName(java.lang.String columnName)
getColumnName in class DatabaseTypepublic java.lang.String getDefaultTimeStr()
getDefaultTimeStr in class DatabaseTypepublic java.lang.String getFalseValue()
getFalseValue in class DatabaseTypepublic java.lang.String getName()
getName in class DatabaseTypepublic java.lang.String getPrimaryFileExtension()
getPrimaryFileExtension in class DatabaseTypepublic java.lang.String getTrueValue()
getTrueValue in class DatabaseTypepublic boolean needAbsolutePathForName()
needAbsolutePathForName in class DatabaseTypepublic boolean needHostForConnect()
needHostForConnect in class DatabaseTypepublic boolean needPasswordForConnect()
needPasswordForConnect in class DatabaseTypepublic boolean needUserForConnect()
needUserForConnect in class DatabaseTypepublic void renameColumn(java.lang.String oldName, Column newColumn, java.lang.String tableName) throws java.sql.SQLException
renameColumn in class DatabaseTypejava.sql.SQLExceptionpublic void setColumnNull(Column column, java.lang.String tableName) throws java.sql.SQLException
setColumnNull in class DatabaseTypejava.sql.SQLExceptionpublic void setColumnNotNull(Column column, java.lang.String tableName) throws java.sql.SQLException
setColumnNotNull in class DatabaseTypejava.sql.SQLExceptionpublic static void setForkServers(boolean fork)
public static void shutdownServers()
protected boolean _areForeignKeysIndexed()
_areForeignKeysIndexed in class DatabaseTypeprotected boolean _arePrimaryKeysIndexed()
_arePrimaryKeysIndexed in class DatabaseTypeprotected java.lang.String _getDriverName()
_getDriverName in class DatabaseTypeprotected java.lang.String _getJDBCUrl(java.lang.String hostName, java.lang.String port, java.lang.String databaseName) throws java.sql.SQLException
_getJDBCUrl in class DatabaseTypejava.sql.SQLExceptionprotected java.lang.String _getTypeString(Column column)
_getTypeString in class DatabaseTypeprotected boolean _hasCatalog()
_hasCatalog in class DatabaseTypeprotected boolean _hasGeneratedKeys()
_hasGeneratedKeys in class DatabaseTypeprotected boolean _isTableCached()
_isTableCached in class DatabaseTypeprotected boolean _needCapitalColumnNames()
_needCapitalColumnNames in class DatabaseTypeprotected boolean _needCapitalTableNames()
_needCapitalTableNames in class DatabaseTypeprotected java.sql.Connection _getConnection(java.lang.String jdbcURL) throws java.sql.SQLException
_getConnection in class DatabaseTypejava.sql.SQLExceptionprotected 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 DatabaseTypejava.sql.SQLExceptionpublic static void checkpointAllServers()
protected void _executeSQL(java.lang.String sqlStr, java.sql.Connection connection) throws java.sql.SQLException
java.sql.SQLExceptionprotected static void _deletePortFile(java.lang.String dbName)