public interface DbmsBean
Modifier and Type | Method and Description |
---|---|
void |
changeTableNameToUpperCase(Connection connection,
String oldName)
Rename table from lower case to upper case.
|
boolean |
dropColumn(Connection connection,
String tableName,
String columnName)
Checks whether given table contains the specified column and drops it
|
boolean |
dropColumn(Connection connection,
String tableName,
String columnName,
List<String> defaultConstraintNames,
String indexName)
Checks whether given table contains the specified column and drops it, as well as foreign key constraints and index on the column.
|
void |
dropPrimaryKey(Connection connection,
String tableName)
Drops the primary key on a table.
|
String |
getConcat(String... values)
Provide a different SQL concatenation operator depending on SQL engine used.
|
DatabaseType |
getDatabaseType()
Detect used database type
|
String |
getQuery(SqlQueryProvider sqlQueryProvider)
Provide a different SQL query depending on SQL engine used.
|
boolean |
isColumnPresent(Connection connection,
String tableName,
String columnName)
Checks whether given table contains the specified column.
|
boolean |
isColumnPresent(Statement statement,
String tableName,
String columnName)
Checks whether given table contains the specified column.
|
boolean |
isHsqldb() |
boolean |
isMsSqlServer() |
boolean |
isMySql() |
boolean |
isOracle() |
boolean |
isPostgreSql() |
boolean |
isTablePresent(Connection connection,
String tableName)
Checks whether given table is present in the database
|
boolean |
isTablePresent(Statement statement,
String tableName)
Checks whether given table is present in the database
|
PreparedStatement |
prepareStatement(Connection connection,
PreparedStatementProvider preparedStatementProvider)
Provide a different
PreparedStatement depending on SQL engine used. |
void |
renameColumn(Connection connection,
String tableName,
String oldName,
String newName)
Rename columns.
|
void |
resizeVarcharColumn(Statement statement,
String tableName,
String columnName,
int newSize,
boolean isNullable,
String defaultValue) |
@NotNull String getQuery(@NotNull SqlQueryProvider sqlQueryProvider)
sqlQueryProvider
- @NotNull String getConcat(String... values)
values
- the values to concatenate.@NotNull PreparedStatement prepareStatement(@NotNull Connection connection, @NotNull PreparedStatementProvider preparedStatementProvider) throws SQLException
PreparedStatement
depending on SQL engine used.connection
- preparedStatementProvider
- SQLException
boolean isColumnPresent(@NotNull Connection connection, @NotNull String tableName, @NotNull String columnName) throws SQLException
connection
- tableName
- columnName
- SQLException
boolean isColumnPresent(@NotNull Statement statement, @NotNull String tableName, @NotNull String columnName) throws SQLException
statement
- tableName
- columnName
- SQLException
boolean dropColumn(@NotNull Connection connection, @NotNull String tableName, @NotNull String columnName) throws SQLException
connection
- tableName
- columnName
- SQLException
boolean dropColumn(@NotNull Connection connection, @NotNull String tableName, @NotNull String columnName, @NotNull List<String> defaultConstraintNames, @Nullable String indexName) throws SQLException
connection
- tableName
- columnName
- defaultConstraintNames
- indexName
- SQLException
boolean isTablePresent(@NotNull Statement statement, @NotNull String tableName)
statement
- statement used to verify DB table existencetableName
- name of DB tableboolean isTablePresent(@NotNull Connection connection, @NotNull String tableName) throws SQLException
connection
- connection used to verify DB table existencetableName
- name of DB tableSQLException
- if a database error occurs or connection is closedvoid resizeVarcharColumn(@NotNull Statement statement, String tableName, String columnName, int newSize, boolean isNullable, @Nullable String defaultValue) throws SQLException
SQLException
boolean isMySql()
boolean isOracle()
boolean isHsqldb()
boolean isPostgreSql()
boolean isMsSqlServer()
DatabaseType getDatabaseType()
void dropPrimaryKey(Connection connection, String tableName) throws SQLException
SQLException
void changeTableNameToUpperCase(Connection connection, String oldName) throws SQLException
SQLException
void renameColumn(Connection connection, String tableName, String oldName, String newName) throws SQLException
SQLException
Copyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.