|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
java.lang.Objectplay.db.DB
public class DB
Database connection utilities. This class holds reference to all DB configurations. Each configuration has its own instance of DBConfig. dbConfigName corresponds to properties-names in application.conf. The default DBConfig is the one configured using 'db.' in application.conf dbConfigName = 'other' is configured like this: db_other = mem db_other.user = batman This class also preserves backward compatibility by directing static methods to the default DBConfig-instance
构造方法摘要 | |
---|---|
DB()
|
方法摘要 | |
---|---|
static void |
close()
Close all connections opened for the current thread. |
static void |
destroy()
Destroy the datasources |
static boolean |
execute(java.lang.String SQL)
Execute an SQL update |
static java.sql.ResultSet |
executeQuery(java.lang.String SQL)
Execute an SQL query |
static java.sql.Connection |
getConnection()
Open a connection for the current thread. |
static DBConfig |
getDBConfig()
The default DBConfig is the one configured using 'db.' in application.conf |
static DBConfig |
getDBConfig(java.lang.String dbConfigName)
dbConfigName corresponds to properties-names in application.conf. |
static DBConfig |
getDBConfig(java.lang.String dbConfigName,
boolean ignoreError)
dbConfigName corresponds to properties-names in application.conf. |
static java.util.Collection<DBConfig> |
getDBConfigs()
|
protected static java.lang.String |
getStatus()
|
protected static void |
setConfigurations(java.util.List<java.lang.String> dbConfigNames)
Sets the new list of db configurations. |
从类 java.lang.Object 继承的方法 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
构造方法详细信息 |
---|
public DB()
方法详细信息 |
---|
protected static void setConfigurations(java.util.List<java.lang.String> dbConfigNames)
dbConfigNames
- public static DBConfig getDBConfig()
public static DBConfig getDBConfig(java.lang.String dbConfigName)
dbConfigName
- name of the config
public static DBConfig getDBConfig(java.lang.String dbConfigName, boolean ignoreError)
dbConfigName
- name of the configignoreError
- set to true if null should be returned if config is missing
public static void close()
public static java.sql.Connection getConnection()
public static boolean execute(java.lang.String SQL)
SQL
-
public static java.sql.ResultSet executeQuery(java.lang.String SQL)
SQL
-
public static void destroy()
protected static java.lang.String getStatus()
public static java.util.Collection<DBConfig> getDBConfigs()
|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |