Class DBUtils


  • public final class DBUtils
    extends Object
    • 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