|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.j256.ormlite.db.DatabaseTypeUtils
public class DatabaseTypeUtils
Utility class which helps with managing database specific classes.
| Method Summary | |
|---|---|
static DatabaseType |
createDatabaseType(DataSource dataSource)
Creates and returns a DatabaseType associated with a DataSource. |
static DatabaseType |
createDatabaseType(String databaseUrl)
Creates and returns a DatabaseType for the database URL. |
static SimpleDataSource |
createSimpleDataSource(String databaseUrl)
Creates and returns a SimpleDataSource associated with the databaseUrl and optional userName and password. |
static SimpleDataSource |
createSimpleDataSource(String databaseUrl,
String userName,
String password)
Creates and returns a SimpleDataSource associated with the databaseUrl and optional userName and
password. |
static void |
loadDriver(String databaseUrl)
Examines the databaseUrl parameter and load the driver for the proper database type if it can. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void loadDriver(String databaseUrl)
throws ClassNotFoundException
IllegalArgumentException - if the url format is not recognized or the database type is unknown.
ClassNotFoundException - If the database class is unknown.
public static SimpleDataSource createSimpleDataSource(String databaseUrl)
throws SQLException
loadDriver(java.lang.String) as well. You can, of course, provide your own DataSource for use with the package.
SQLException - If there are problems constructing the DataSource.
public static SimpleDataSource createSimpleDataSource(String databaseUrl,
String userName,
String password)
throws SQLException
SimpleDataSource associated with the databaseUrl and optional userName and
password. Calls loadDriver(java.lang.String) as well.
SQLException - If there are problems constructing the DataSource.public static DatabaseType createDatabaseType(String databaseUrl)
DatabaseType for the database URL.
IllegalArgumentException - if the url format is not recognized, the database type is unknown, or the class could not be
constructed.
public static DatabaseType createDatabaseType(DataSource dataSource)
throws SQLException
createDatabaseType(String) is recommended.
SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||