|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ddlutils.PlatformFactory
A factory of Platform
instances based on a case
insensitive database name. Note that this is a convenience class as the platforms
can also simply be created via their constructors.
Constructor Summary | |
PlatformFactory()
|
Method Summary | |
static Platform |
createNewPlatformInstance(DataSource dataSource)
Creates a new platform for the specified database. |
static Platform |
createNewPlatformInstance(DataSource dataSource,
String username,
String password)
Creates a new platform for the specified database. |
static Platform |
createNewPlatformInstance(String databaseName)
Creates a new platform for the given (case insensitive) database name or returns null if the database is not recognized. |
static Platform |
createNewPlatformInstance(String jdbcDriver,
String jdbcConnectionUrl)
Creates a new platform for the specified database. |
static String[] |
getSupportedPlatforms()
Returns a list of all supported platforms. |
static boolean |
isPlatformSupported(String platformName)
Determines whether the indicated platform is supported. |
static void |
registerPlatform(String platformName,
Class platformClass)
Registers a new platform. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PlatformFactory()
Method Detail |
public static Platform createNewPlatformInstance(String databaseName) throws DdlUtilsException
databaseName
- The name of the database (case is not important)
null
if the database is not supported
DdlUtilsException
public static Platform createNewPlatformInstance(String jdbcDriver, String jdbcConnectionUrl) throws DdlUtilsException
PlatformUtils.determineDatabaseType(String, String)
to determine the parameter
for createNewPlatformInstance(String)
. Note that no database connection is
established when using this method.
jdbcDriver
- The jdbc driverjdbcConnectionUrl
- The connection url
null
if the database is not supported
DdlUtilsException
public static Platform createNewPlatformInstance(DataSource dataSource) throws DdlUtilsException
PlatformUtils.determineDatabaseType(DataSource)
to determine the parameter
for createNewPlatformInstance(String)
. Note that this method sets the data source
at the returned platform instance (method Platform.setDataSource(DataSource)
).
dataSource
- The data source for the database
null
if the database is not supported
DdlUtilsException
public static Platform createNewPlatformInstance(DataSource dataSource, String username, String password) throws DdlUtilsException
PlatformUtils.determineDatabaseType(DataSource)
to determine the parameter
for createNewPlatformInstance(String)
. Note that this method sets the data source
at the returned platform instance (method Platform.setDataSource(DataSource)
).
dataSource
- The data source for the databaseusername
- The user name to use for connecting to the databasepassword
- The password to use for connecting to the database
null
if the database is not supported
DdlUtilsException
public static String[] getSupportedPlatforms()
public static boolean isPlatformSupported(String platformName)
platformName
- The name of the platform
true
if the platform is supportedpublic static void registerPlatform(String platformName, Class platformClass)
platformName
- The platform nameplatformClass
- The platform class which must implement the Platform
interface
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |