Package org.javalite.db_migrator
Class DbUtils
java.lang.Object
org.javalite.db_migrator.DbUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
static void
closeQuietly(Object toClose)
static DatabaseType
databaseType(String url)
static String
driverClass(String url)
Given a jdbc url, this tries to determine the target database and returns the driver class name as a string.static int
static String
extractDatabaseName(String url)
Given a JDBC connection URL, extract only the database name.static String
extractServerUrl(String url)
Given a JDBC connection URL, generate a new connection URL to connect directly to the database server itself (ie: no database specified).
-
Method Details
-
driverClass
Given a jdbc url, this tries to determine the target database and returns the driver class name as a string.- Parameters:
url
- jdbc url- Returns:
- jdbc driver class name
-
databaseType
-
extractDatabaseName
Given a JDBC connection URL, extract only the database name.- Parameters:
url
- a JDBC connection URL- Returns:
- the database name
-
extractServerUrl
Given a JDBC connection URL, generate a new connection URL to connect directly to the database server itself (ie: no database specified).- Parameters:
url
- a JDBC connection URL- Returns:
- a new JDBC connection URL to connect directly to the database server
-
exec
-
closeQuietly
-
blank
-