public class DbUtils extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
blank(String str) |
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 |
exec(String statement,
Object... params) |
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).
|
public static String driverClass(String url)
url
- jdbc urlpublic static DatabaseType databaseType(String url)
public static String extractDatabaseName(String url)
url
- a JDBC connection URLpublic static String extractServerUrl(String url)
url
- a JDBC connection URLpublic static void closeQuietly(Object toClose)
public static boolean blank(String str)
Copyright © 2020 JavaLite. All rights reserved.