📄 enginefactory.java
字号:
package org.speedframework.engine;
import java.sql.Connection;
import org.speedframework.conneciton.ConnectionFactory;
import org.speedframework.exception.SpeedException;
import org.speedframework.engine.impl.EngineImpl;
/**
* <p>Title: SpeedFrameworkWork持久层框架</p>
*
* <p>Description: 主入口工厂类</p>
*
* <p>Copyright: Copyright (c) 2006</p>
*
* <p>Company: SpeedFrameworkWork team</p>
* @author 李志峰 电话:13824431576 程伟杰 电话:13926047208
* @version 1.0
*/
public class EngineFactory {
public EngineFactory() {
}
/**
* 取得数据库操作引擎(指定连接id)
*
* @param connection_factory_id String speed.cfg.xml
* 配置文件内指定connection-factory id参数
* @throws SpeedException 核心引擎异常
* @return Engine
*/
public static Engine getEngine(String connection_factory_id) throws
SpeedException {
if (connection_factory_id == null || connection_factory_id.equals("")) {
throw new SpeedException("The id does't not specify");
}
Connection con = ConnectionFactory.getConnection(false,
connection_factory_id);
return new EngineImpl(con);
}
/**
* 取得数据库操作引擎
*
* @throws SpeedException 核心引擎异常
* @return Engine
*/
public static Engine getEngine() throws
SpeedException {
Connection con = ConnectionFactory.getConnection(false);
return new EngineImpl(con);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -