Package org.wso2.carbon.utils
Class DBUtils
java.lang.Object
org.wso2.carbon.utils.DBUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanReturnGeneratedKeys(String dbProductName) Determines whether the given type of Database can return generated keys.static StringgetConvertedAutoGeneratedColumnName(String dbProductName, String columnName) Converts upper case column name to lower case to match PostgreSQL.static Stringget the registry.xml database typestatic Stringget the user-mgt.xml database type
-
Method Details
-
getConvertedAutoGeneratedColumnName
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
Determines whether the given type of Database can return generated keys.- Parameters:
dbProductName- - eg: "MySQL,Oracle,PostgreSQL". Obtained using Connection.getMetaData().getDatabaseProductName();- Returns:
-
getRegistryDBConfig
get the registry.xml database type- Returns:
- database name from the registry.xml
- Throws:
Exception
-
getUserManagerDBConfig
get the user-mgt.xml database type- Returns:
- database name from the user-mgt.xml
- Throws:
Exception
-