Package org.wso2.carbon.utils.dbcreator
Class DatabaseCreator
java.lang.Object
org.wso2.carbon.utils.dbcreator.DatabaseCreator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckStringBufferEndsWith(StringBuffer buffer, String suffix) Checks that a string buffer ends up with a given string.voidCreates registry databasestatic StringgetDatabaseType(String dbUrl) Overloaded method with String inputstatic StringgetDatabaseType(Connection conn) computes relatational database type using database nameprotected StringgetDbScriptLocation(String databaseType) booleanisDatabaseStructureCreated(String checkSQL) Checks whether database tables are created.
-
Constructor Details
-
DatabaseCreator
-
-
Method Details
-
createRegistryDatabase
Creates registry database- Throws:
Exception
-
isDatabaseStructureCreated
Checks whether database tables are created.- Parameters:
checkSQL- SQL execute during check.- Returns:
true if checkSQL is success, elsefalse.
-
getDatabaseType
computes relatational database type using database name- Returns:
- String
- Throws:
Exception
-
getDatabaseType
Overloaded method with String input- Returns:
- String
- Throws:
Exception
-
getDbScriptLocation
-
checkStringBufferEndsWith
Checks that a string buffer ends up with a given string. It may sound trivial with the existing JDK API but the various implementation among JDKs can make those methods extremely resource intensive and perform poorly due to massive memory allocation and copying. See- Parameters:
buffer- the buffer to perform the check onsuffix- the suffix- Returns:
trueif the character sequence represented by the argument is a suffix of the character sequence represented by the StringBuffer object;falseotherwise. Note that the result will betrueif the argument is the empty string.
-