public class DB extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DB.ExtendedDatasource |
Modifier and Type | Field and Description |
---|---|
static DataSource |
datasource
Deprecated.
Use datasources instead
|
protected static Map<String,DB.ExtendedDatasource> |
datasources
The loaded datasource.
|
static String |
DEFAULT |
static String |
destroyMethod
Deprecated.
Use datasources instead
|
Constructor and Description |
---|
DB() |
Modifier and Type | Method and Description |
---|---|
static void |
close()
Close all the open connections for the current thread.
|
static void |
close(String name)
Close an given open connections for the current thread
|
static void |
closeAll()
Close all the open connections for the current thread.
|
static void |
destroy()
Destroy the datasource
|
static void |
destroy(String name)
Destroy the datasource
|
static void |
destroyAll()
Destroy all datasources
|
static boolean |
execute(String SQL) |
static boolean |
execute(String name,
String SQL)
Execute an SQL update
|
static RowSet |
executeQuery(String SQL) |
static RowSet |
executeQuery(String name,
String SQL)
Execute an SQL query
|
static Connection |
getConnection() |
static Connection |
getConnection(String name)
Open a connection for the current thread.
|
static Connection |
getConnection(String name,
boolean autocommit) |
static DataSource |
getDataSource() |
static DataSource |
getDataSource(String name) |
static void |
safeCloseResultSet(ResultSet resultSet) |
static void |
safeCloseStatement(Statement statement) |
protected static final Map<String,DB.ExtendedDatasource> datasources
DB.ExtendedDatasource
@Deprecated public static DataSource datasource
datasources
,
DB.ExtendedDatasource
@Deprecated public static String destroyMethod
datasources
,
DB.ExtendedDatasource
public static final String DEFAULT
public static DataSource getDataSource(String name)
public static DataSource getDataSource()
public static Connection getConnection(String name, boolean autocommit)
public static void closeAll()
public static void close()
public static void close(String name)
public static Connection getConnection(String name)
public static Connection getConnection()
public static boolean execute(String name, String SQL)
SQL
- public static boolean execute(String SQL)
public static RowSet executeQuery(String name, String SQL)
SQL
- public static void safeCloseResultSet(ResultSet resultSet)
public static void safeCloseStatement(Statement statement)
public static void destroy(String name)
public static void destroy()
public static void destroyAll()
Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly