@Module public class JDBC extends Object implements net.ymate.platform.core.module.IModule, IDatabase
| 限定符和类型 | 类和说明 |
|---|---|
static class |
JDBC.DATABASE
数据库类型
|
static class |
JDBC.TRANSACTION
数据库事务类型
|
| 限定符和类型 | 字段和说明 |
|---|---|
static Map<JDBC.DATABASE,Class<? extends IDialect>> |
DB_DIALECTS
框架提供的已知数据库方言
|
static Map<JDBC.DATABASE,String> |
DB_DRIVERS
框架提供的已知数据库连接驱动
|
static Map<String,String> |
DS_ADAPTERS
框架提供的已知数据源适配器名称映射
|
static net.ymate.platform.core.Version |
VERSION |
MODULE_NAME| 构造器和说明 |
|---|
JDBC() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
destroy() |
static IDatabase |
get() |
static IDatabase |
get(net.ymate.platform.core.YMP owner) |
IConnectionHolder |
getConnectionHolder(String dsName) |
IConnectionHolder |
getDefaultConnectionHolder() |
IDatabaseModuleCfg |
getModuleCfg() |
String |
getName() |
net.ymate.platform.core.YMP |
getOwner() |
void |
init(net.ymate.platform.core.YMP owner) |
boolean |
isInited() |
ISession |
openSession() |
ISession |
openSession(IConnectionHolder connectionHolder) |
<T> T |
openSession(IConnectionHolder connectionHolder,
ISessionExecutor<T> executor) |
ISession |
openSession(IDataSourceRouter dataSourceRouter) |
<T> T |
openSession(IDataSourceRouter dataSourceRouter,
ISessionExecutor<T> executor) |
<T> T |
openSession(ISessionExecutor<T> executor) |
ISession |
openSession(String dsName) |
<T> T |
openSession(String dsName,
ISessionExecutor<T> executor) |
void |
releaseConnectionHolder(IConnectionHolder connectionHolder)
安全关闭数据源的连接持有者(确保非事务状态下执行关闭)
|
public static final net.ymate.platform.core.Version VERSION
public static Map<JDBC.DATABASE,String> DB_DRIVERS
public static Map<JDBC.DATABASE,Class<? extends IDialect>> DB_DIALECTS
public static IDatabase get()
public static IDatabase get(net.ymate.platform.core.YMP owner)
owner - YMP框架管理器实例public String getName()
getName 在接口中 net.ymate.platform.core.module.IModulepublic void init(net.ymate.platform.core.YMP owner)
throws Exception
init 在接口中 net.ymate.platform.core.support.IInitializable<net.ymate.platform.core.YMP>Exceptionpublic boolean isInited()
isInited 在接口中 net.ymate.platform.core.module.IModulepublic void destroy()
throws Exception
destroy 在接口中 net.ymate.platform.core.support.IDestroyableExceptionpublic net.ymate.platform.core.YMP getOwner()
public IDatabaseModuleCfg getModuleCfg()
getModuleCfg 在接口中 IDatabasepublic IConnectionHolder getDefaultConnectionHolder() throws Exception
getDefaultConnectionHolder 在接口中 IDatabaseException - 可能产生的异常public IConnectionHolder getConnectionHolder(String dsName) throws Exception
getConnectionHolder 在接口中 IDatabasedsName - 数据源名称Exception - 可能产生的异常public void releaseConnectionHolder(IConnectionHolder connectionHolder) throws Exception
IDatabasereleaseConnectionHolder 在接口中 IDatabaseconnectionHolder - 数据源的连接持有者对象Exception - 可能产生的异常public <T> T openSession(ISessionExecutor<T> executor) throws Exception
openSession 在接口中 IDatabaseExceptionpublic <T> T openSession(String dsName, ISessionExecutor<T> executor) throws Exception
openSession 在接口中 IDatabaseExceptionpublic <T> T openSession(IConnectionHolder connectionHolder, ISessionExecutor<T> executor) throws Exception
openSession 在接口中 IDatabaseExceptionpublic <T> T openSession(IDataSourceRouter dataSourceRouter, ISessionExecutor<T> executor) throws Exception
openSession 在接口中 IDatabaseExceptionpublic ISession openSession() throws Exception
openSession 在接口中 IDatabaseException - 可能产生的异常public ISession openSession(String dsName) throws Exception
openSession 在接口中 IDatabaseExceptionpublic ISession openSession(IConnectionHolder connectionHolder) throws Exception
openSession 在接口中 IDatabaseExceptionpublic ISession openSession(IDataSourceRouter dataSourceRouter) throws Exception
openSession 在接口中 IDatabaseExceptionCopyright © 2019. All rights reserved.