public class DatabaseCreator extends Object
Constructor and Description |
---|
DatabaseCreator(DataSource dataSource) |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkStringBufferEndsWith(StringBuffer buffer,
String suffix)
Checks that a string buffer ends up with a given string.
|
void |
createRegistryDatabase()
Creates registry database
|
static String |
getDatabaseType(Connection conn)
computes relatational database type using database name
|
static String |
getDatabaseType(String dbUrl)
Overloaded method with String input
|
protected String |
getDbScriptLocation(String databaseType) |
boolean |
isDatabaseStructureCreated(String checkSQL)
Checks whether database tables are created.
|
public DatabaseCreator(DataSource dataSource)
public void createRegistryDatabase() throws Exception
Exception
public boolean isDatabaseStructureCreated(String checkSQL)
checkSQL
- SQL execute during check.true if checkSQL is success, else false
.
public static String getDatabaseType(Connection conn) throws Exception
Exception*
Exception
public static String getDatabaseType(String dbUrl) throws Exception
Exception*
Exception
public static boolean checkStringBufferEndsWith(StringBuffer buffer, String suffix)
buffer
- the buffer to perform the check onsuffix
- the suffixtrue
if the character sequence represented by the
argument is a suffix of the character sequence represented by
the StringBuffer object; false
otherwise. Note that the
result will be true
if the argument is the
empty string.Copyright © 2016 WSO2 Inc. All rights reserved.