com.atlassian.bamboo.setup
Class DbmsSpecificUtils

java.lang.Object
  extended by com.atlassian.bamboo.setup.DbmsSpecificUtils

public class DbmsSpecificUtils
extends java.lang.Object

This class holds utility methods used when DBMS has to be accessed without Hibernate.


Field Summary
static java.lang.String PROPERTY_HIBERNATE_DIALECT
           
 
Constructor Summary
DbmsSpecificUtils(com.atlassian.config.db.HibernateConfig hibernateConfig)
           
 
Method Summary
static void dropMsSqlForeignKeyConstraints(java.sql.Statement statement, java.lang.String tableName)
          Drops foreign key constraints defined for a table
static java.sql.ResultSet getMsSqlForeignKeyConstraintsForTable(java.sql.Statement statement, java.lang.String tableName)
          Retrieves foreign key constraints defined for a table
static boolean isColumnPresent(java.sql.Connection connection, java.lang.String tableName, java.lang.String columnName)
          Deprecated. since 3.3 Use DbmsBean.isColumnPresent(Connection, String, String)
static boolean isColumnPresent(java.sql.Statement statement, java.lang.String tableName, java.lang.String columnName)
          Deprecated. since 3.3 Use DbmsBean.isColumnPresent(Statement, String, String)
 boolean isHsqldb()
          Deprecated. since 3.3 Use DbmsBean.isHsqldb()
 boolean isMsSqlServer()
          Deprecated. since 3.3 Use DbmsBean.isMsSqlServer()
 boolean isMySql()
          Deprecated. since 3.3 Use DbmsBean.isMySql()
 boolean isOracle()
          Deprecated. since 3.3 Use DbmsBean.isOracle()
 boolean isPostgreSQL()
          Deprecated. since 3.3 Use DbmsBean.isPostgreSql()
static boolean isTablePresent(java.sql.Connection connection, java.lang.String tableName)
          Deprecated. since 3.3 Use DbmsBean.isTablePresent(Connection, String)
static boolean isTablePresent(java.sql.Statement statement, java.lang.String tableName)
          Deprecated. since 3.3 Use DbmsBean.isTablePresent(Statement, String)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_HIBERNATE_DIALECT

public static final java.lang.String PROPERTY_HIBERNATE_DIALECT
See Also:
Constant Field Values
Constructor Detail

DbmsSpecificUtils

public DbmsSpecificUtils(@NotNull
                         com.atlassian.config.db.HibernateConfig hibernateConfig)
Method Detail

isMySql

@Deprecated
public boolean isMySql()
Deprecated. since 3.3 Use DbmsBean.isMySql()

Checks whether the db configured in Hibernate is MySQL

Returns:

isOracle

@Deprecated
public boolean isOracle()
Deprecated. since 3.3 Use DbmsBean.isOracle()

Checks whether the db configured in Hibernate is Oracle (8/9 dialect)

Returns:

isHsqldb

@Deprecated
public boolean isHsqldb()
Deprecated. since 3.3 Use DbmsBean.isHsqldb()

Checks whether the db configured in Hibernate is HSQL

Returns:

isPostgreSQL

@Deprecated
public boolean isPostgreSQL()
Deprecated. since 3.3 Use DbmsBean.isPostgreSql()

Checks whether the db configured in Hibernate is PostgreSQL

Returns:

isMsSqlServer

@Deprecated
public boolean isMsSqlServer()
Deprecated. since 3.3 Use DbmsBean.isMsSqlServer()

Checks whether the db configured in Hibernate is MS SQL Server (international/standard)

Returns:

getMsSqlForeignKeyConstraintsForTable

public static java.sql.ResultSet getMsSqlForeignKeyConstraintsForTable(java.sql.Statement statement,
                                                                       java.lang.String tableName)
                                                                throws java.sql.SQLException
Retrieves foreign key constraints defined for a table

Parameters:
statement -
tableName -
Returns:
Throws:
java.sql.SQLException

dropMsSqlForeignKeyConstraints

public static void dropMsSqlForeignKeyConstraints(java.sql.Statement statement,
                                                  java.lang.String tableName)
                                           throws java.sql.SQLException
Drops foreign key constraints defined for a table

Throws:
java.sql.SQLException

isTablePresent

@Deprecated
public static boolean isTablePresent(java.sql.Statement statement,
                                                java.lang.String tableName)
Deprecated. since 3.3 Use DbmsBean.isTablePresent(Statement, String)

Checks whether given table is present in the database

Parameters:
statement -
tableName -
Returns:

isTablePresent

@Deprecated
public static boolean isTablePresent(java.sql.Connection connection,
                                                java.lang.String tableName)
                              throws java.sql.SQLException
Deprecated. since 3.3 Use DbmsBean.isTablePresent(Connection, String)

Checks whether given table is present in the database

Parameters:
connection - connection used to verify DB table existence
tableName - name of DB table
Returns:
true if database is accessible and table exists, false otherwise
Throws:
java.sql.SQLException - if a database error occurs or connection is closed

isColumnPresent

@Deprecated
public static boolean isColumnPresent(@NotNull
                                                 java.sql.Statement statement,
                                                 @NotNull
                                                 java.lang.String tableName,
                                                 @NotNull
                                                 java.lang.String columnName)
                               throws java.sql.SQLException
Deprecated. since 3.3 Use DbmsBean.isColumnPresent(Statement, String, String)

Checks whether given table contains the specified column.

Parameters:
statement -
tableName -
columnName -
Returns:
Throws:
java.sql.SQLException

isColumnPresent

@Deprecated
public static boolean isColumnPresent(@NotNull
                                                 java.sql.Connection connection,
                                                 @NotNull
                                                 java.lang.String tableName,
                                                 @NotNull
                                                 java.lang.String columnName)
                               throws java.sql.SQLException
Deprecated. since 3.3 Use DbmsBean.isColumnPresent(Connection, String, String)

Checks whether given table contains the specified column.

Parameters:
connection -
tableName -
columnName -
Returns:
Throws:
java.sql.SQLException


Copyright © 2012 Atlassian. All Rights Reserved.