本文整理汇总了Java中org.logicalcobwebs.proxool.configuration.JAXPConfigurator类的典型用法代码示例。如果您正苦于以下问题:Java JAXPConfigurator类的具体用法?Java JAXPConfigurator怎么用?Java JAXPConfigurator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JAXPConfigurator类属于org.logicalcobwebs.proxool.configuration包,在下文中一共展示了JAXPConfigurator类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: contextInitialized
import org.logicalcobwebs.proxool.configuration.JAXPConfigurator; //导入依赖的package包/类
/**
*
* 初始化proxool数据库连接池
*
* @param event
*
* @return ModelAndView
*/
public void contextInitialized(ServletContextEvent event)
{
LOG.info("ProxoolInitialListener init ...");
String appDir = event.getServletContext().getRealPath("/");
String value = event.getServletContext().getInitParameter("proxoolXmlFile");
try
{
File file = new File(value);
if (file.isAbsolute())
{
JAXPConfigurator.configure(value, false);
}
else
{
JAXPConfigurator.configure(appDir + File.separator + value, false);
}
}
catch (ProxoolException e)
{
LOG.error("Problem configuring " + value, e);
}
}
开发者ID:GooDay0923,项目名称:java-framework-with-springmvc-mybatis-proxool,代码行数:31,代码来源:ProxoolInitialListener.java
示例2: registerPoolFromXml
import org.logicalcobwebs.proxool.configuration.JAXPConfigurator; //导入依赖的package包/类
/**
* 根据xml配置文件注册数据库连接池
*
* @param configFile
* -- xml配置文件路径
* @exception -- 运行时应用异常(RuntimeAppException)
*/
public static synchronized void registerPoolFromXml(String configFile) {
try {
logger.info("尝试根据xml配置文件[{}]注册数据库连接池", configFile);
InputStream is = DbConnectionProvider.class.getResourceAsStream(configFile);
if (null != is) {
InputStreamReader in = new InputStreamReader(is);
JAXPConfigurator.configure(in, false);
} else {
logger.error("xml配置文件[{}]不存在.", configFile);
}
} catch (Exception ex) {
throw new FwRuntimeException("通过xml配置文件注册proxool数据库连接池异常", ex);
}
}
开发者ID:bignippleboy,项目名称:ipaas,代码行数:24,代码来源:DbConnectionProvider.java
示例3: init
import org.logicalcobwebs.proxool.configuration.JAXPConfigurator; //导入依赖的package包/类
public static void init() {
try {
logger.info("init database connection pool……");
JAXPConfigurator.configure("configs/proxool.xml", true);
} catch (ProxoolException e) {
logger.error("read config failed ", e);
System.exit(-1);
}
}
开发者ID:kingston-csj,项目名称:jforgame,代码行数:10,代码来源:DbUtils.java
示例4: init
import org.logicalcobwebs.proxool.configuration.JAXPConfigurator; //导入依赖的package包/类
public static void init(String dbPath) {
try {
logger.info("初始化数据库连接池……");
JAXPConfigurator.configure(dbPath, true);
} catch (ProxoolException e) {
e.printStackTrace();
logger.error("读取数据库配置文件出错 " + e.getMessage(), e);
}
}
开发者ID:kingston-csj,项目名称:jforgame,代码行数:10,代码来源:DbHelper.java
示例5: DBManager
import org.logicalcobwebs.proxool.configuration.JAXPConfigurator; //导入依赖的package包/类
private DBManager(){
try {
//数据库连接池配置文件
JAXPConfigurator.configure(DBPool.getDBPool().getPoolPath(), false);
Class.forName("org.logicalcobwebs.proxool.ProxoolDriver");
} catch (Exception e) {
e.printStackTrace();
}
}
开发者ID:FrankXiong,项目名称:cqunews-web,代码行数:10,代码来源:DBManager.java
示例6: configProxoolAlias
import org.logicalcobwebs.proxool.configuration.JAXPConfigurator; //导入依赖的package包/类
public static void configProxoolAlias(String jdbcUsername, String jdbcPassword, String jdbcUrl,
String jdbcDriverClassname, int fixedConnectioinSize) {
try {
StringBuffer htmlText = new StringBuffer();
if (ProxoolConfigTemplate != null && !ProxoolConfigTemplate.isEmpty()) {
htmlText.append(ProxoolConfigTemplate);
} else {
try (InputStream resource = ClassLoader.getSystemResourceAsStream(ProxoolFilename)) {
byte[] resourceConfigDatas = StreamUtil.readBytes(resource);
htmlText.append(new String(resourceConfigDatas, java.nio.charset.StandardCharsets.UTF_8));
}
}
Jerry doc = Jerry.jerry(htmlText.toString());
for (Jerry node : doc.$("proxool")) {
if (node.$("alias").text().equals(ProxoolAliasname)) {
node.$("driver-url").text(jdbcUrl);
node.$("driver-class").text(jdbcDriverClassname);
Jerry driverProperties = node.$("driver-properties property");
for (Jerry prop : driverProperties) {
if (prop.attr("name").equals("user"))
prop.attr("value", jdbcUsername);
else if (prop.attr("name").equals("password"))
prop.attr("value", jdbcPassword);
}
if (fixedConnectioinSize != 0) {
node.$("maximum-connection-count").text(String.valueOf(fixedConnectioinSize));
node.$("minimum-connection-count").text(String.valueOf(fixedConnectioinSize));
}
break;
}
}
String configXml = doc.html();
configXml = Toolset.deleteCRLFOnce(configXml);
Toolset.prettyOutput(log,
"ProxoolHelper Config {nl}{}",
configXml);
try (StringReader stringReader = new StringReader(configXml)) {
JAXPConfigurator.configure(stringReader, false);
}
} catch (Throwable e) {
log.info("[ProxoolHelper] initialize proxoool exceptioin !!!.", e);
}
}
开发者ID:316181444,项目名称:GameServerFramework,代码行数:53,代码来源:ProxoolHelper.java
注:本文中的org.logicalcobwebs.proxool.configuration.JAXPConfigurator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论