org.wso2.carbon.utils
Class DBUtils

java.lang.Object
  extended by org.wso2.carbon.utils.DBUtils

public final class DBUtils
extends Object


Method Summary
static boolean canReturnGeneratedKeys(String dbProductName)
          Determines whether the given type of Database can return generated keys.
static String getConvertedAutoGeneratedColumnName(String dbProductName, String columnName)
          Converts upper case column name to lower case to match PostgreSQL.
static String getRegistryDBConfig()
          get the registry.xml database type
static String getUserManagerDBConfig()
          get the user-mgt.xml database type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getConvertedAutoGeneratedColumnName

public static String getConvertedAutoGeneratedColumnName(String dbProductName,
                                                         String columnName)
Converts upper case column name to lower case to match PostgreSQL.

Parameters:
dbProductName - - eg: "MySQL,Oracle,PostgreSQL". Obtained using Connection.getMetaData().getDatabaseProductName();
columnName - - table column name to be converted
Returns:

canReturnGeneratedKeys

public static boolean canReturnGeneratedKeys(String dbProductName)
Determines whether the given type of Database can return generated keys.

Parameters:
dbProductName - - eg: "MySQL,Oracle,PostgreSQL". Obtained using Connection.getMetaData().getDatabaseProductName();
Returns:

getRegistryDBConfig

public static String getRegistryDBConfig()
                                  throws Exception
get the registry.xml database type

Returns:
database name from the registry.xml
Throws:
Exception

getUserManagerDBConfig

public static String getUserManagerDBConfig()
                                     throws Exception
get the user-mgt.xml database type

Returns:
database name from the user-mgt.xml
Throws:
Exception


Copyright © 2014 WSO2 Inc. All rights reserved.