public interface DbmsBean
Modifier and Type | Method and Description |
---|---|
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.
|
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()
Deprecated.
since 5.10.0, use getCurrentDatabase == DatabaseType.HSQL
|
boolean |
isMsSqlServer()
Deprecated.
since 5.10.0, use getCurrentDatabase == DatabaseType.MSSQL
|
boolean |
isMySql()
Deprecated.
since 5.10.0, use getCurrentDatabase == DatabaseType.MYSQL
|
boolean |
isOracle()
Deprecated.
since 5.10.0, use getCurrentDatabase == DatabaseType.ORACLE
|
boolean |
isPostgreSql()
Deprecated.
since 5.10.0, use getCurrentDatabase == DatabaseType.POSTGRESQL
|
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 |
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
@Deprecated boolean isMySql()
@Deprecated boolean isOracle()
@Deprecated boolean isHsqldb()
@Deprecated boolean isPostgreSql()
@Deprecated boolean isMsSqlServer()
DatabaseType getDatabaseType()
Copyright © 2016 Atlassian Software Systems Pty Ltd. All rights reserved.