com.atlassian.bamboo.utils.db
Class MsSqlDbmsBean

java.lang.Object
  extended by com.atlassian.bamboo.utils.db.AbstractDbmsBean
      extended by com.atlassian.bamboo.utils.db.MsSqlDbmsBean
All Implemented Interfaces:
DbmsBean

public class MsSqlDbmsBean
extends AbstractDbmsBean


Constructor Summary
MsSqlDbmsBean()
           
 
Method Summary
protected  void dropConstraints(Statement statement, String tableName, String columnName, List<String> defaultConstraintNames)
           
protected  void dropIndex(Statement statement, String indexName)
           
 String getConcat(String... values)
          Provide a different SQL concatenation operator depending on SQL engine used.
 String getQuery(SqlQueryProvider sqlQueryProvider)
          Provide a different SQL query depending on SQL engine used.
 boolean isMsSqlServer()
           
 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)
           
 
Methods inherited from class com.atlassian.bamboo.utils.db.AbstractDbmsBean
dropColumn, dropColumn, isColumnPresent, isColumnPresent, isHsqldb, isMySql, isOracle, isPostgreSql, isTablePresent, isTablePresent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MsSqlDbmsBean

public MsSqlDbmsBean()
Method Detail

getQuery

@NotNull
public String getQuery(@NotNull
                               SqlQueryProvider sqlQueryProvider)
Description copied from interface: DbmsBean
Provide a different SQL query depending on SQL engine used.

Returns:

getConcat

@NotNull
public String getConcat(String... values)
Description copied from interface: DbmsBean
Provide a different SQL concatenation operator depending on SQL engine used.

Parameters:
values - the values to concatenate.
Returns:
the concatenation SQL to append to a query.

prepareStatement

@NotNull
public PreparedStatement prepareStatement(@NotNull
                                                  Connection connection,
                                                  @NotNull
                                                  PreparedStatementProvider preparedStatementProvider)
                                   throws SQLException
Description copied from interface: DbmsBean
Provide a different PreparedStatement depending on SQL engine used.

Returns:
Throws:
SQLException

resizeVarcharColumn

public void resizeVarcharColumn(@NotNull
                                Statement statement,
                                String tableName,
                                String columnName,
                                int newSize,
                                boolean isNullable,
                                @Nullable
                                String defaultValue)
                         throws SQLException
Throws:
SQLException

isMsSqlServer

public boolean isMsSqlServer()
Specified by:
isMsSqlServer in interface DbmsBean
Overrides:
isMsSqlServer in class AbstractDbmsBean
Returns:
true if db configured in Hibernate is Microsoft SQL Server

dropIndex

protected void dropIndex(Statement statement,
                         String indexName)
                  throws SQLException
Overrides:
dropIndex in class AbstractDbmsBean
Throws:
SQLException

dropConstraints

protected void dropConstraints(Statement statement,
                               String tableName,
                               String columnName,
                               List<String> defaultConstraintNames)
Overrides:
dropConstraints in class AbstractDbmsBean


Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.