• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java C3p0Plugin类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.jfinal.plugin.c3p0.C3p0Plugin的典型用法代码示例。如果您正苦于以下问题:Java C3p0Plugin类的具体用法?Java C3p0Plugin怎么用?Java C3p0Plugin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



C3p0Plugin类属于com.jfinal.plugin.c3p0包,在下文中一共展示了C3p0Plugin类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: configPlugin

import com.jfinal.plugin.c3p0.C3p0Plugin; //导入依赖的package包/类
public void configPlugin(Plugins me) {
		// 配置C3p0数据库连接池插件
		 C3p0Plugin c3p0Plugin = new C3p0Plugin(PropKit.get("jdbcUrl"), PropKit.get("user"), PropKit.get("password").trim());
		 me.add(c3p0Plugin);
		// 配置ActiveRecord插件
		ActiveRecordPlugin arp = new ActiveRecordPlugin(c3p0Plugin);
		me.add(arp);
//		 EhCachePlugin ecp = new EhCachePlugin();
//		 me.add(ecp);
		arp.addMapping("wechat_sys_user", SysUser.class);//映射wechat_sys_user表到SysUser模型(映射名字必须与数据库表名一致)
		arp.addMapping("wechat_sys_log", Logs.class);
		arp.addMapping("wechat_user_info", UserInfo.class);
		arp.addMapping("wechat_public_account", PublicAccount.class);
		arp.addMapping("wechat_req_msg_log", ReqMsgLog.class);
		arp.addMapping("wechat_material", Material.class);
	}
 
开发者ID:touzi,项目名称:weChat,代码行数:17,代码来源:WeixinConfig.java


示例2: configPlugin

import com.jfinal.plugin.c3p0.C3p0Plugin; //导入依赖的package包/类
@Override
public void configPlugin(Plugins plugin) {
	loadPropertyFile("jdbc.properties");
	/**
	 * 配置Mysql支持
	 */
	// 配置c3p0数据库连接池插件
	C3p0Plugin cp = new C3p0Plugin(getProperty("mysql.jdbcUrl"), getProperty("mysql.user"), getProperty("mysql.password"));
	plugin.add(cp);		
	// 配置ActiveRecord插件
	ActiveRecordPlugin arp = new ActiveRecordPlugin(cp);
	plugin.add(arp);
	
	// 映射table到model
	arp.addMapping("test_blog", Blog.class);
	
	/**
	 * 配置Oracle支持
	 */
	/*// 配置c3p0数据库连接池插件
	C3p0Plugin cp = new C3p0Plugin(getProperty("oracle.jdbcUrl"), getProperty("oracle.user"), getProperty("oracle.password")); 
	cp.setDriverClass(getProperty("jdbcDriver"));	// 配置Oracle驱动
	plugin.add(cp);
	// 配置ActiveRecord插件
	ActiveRecordPlugin arp = new ActiveRecordPlugin(cp);
	plugin.add(arp);
	arp.setDialect(new OracleDialect());	// 配置Oracle方言
	arp.setContainerFactory(new CaseInsensitiveContainerFactory());	// 配置属性名(字段名)大小写不敏感容器工厂
	
	// 映射table到model
	arp.addMapping("TEST_BLOG","ID", Blog.class);*/
}
 
开发者ID:xuxueli,项目名称:xxl-incubator,代码行数:33,代码来源:CoreConfig.java


示例3: configPlugin

import com.jfinal.plugin.c3p0.C3p0Plugin; //导入依赖的package包/类
@Override
public void configPlugin(Plugins me)
{
	
	C3p0Plugin c3p0Plugin = new C3p0Plugin(getProperty("mysql_url"), getProperty("mysql_username"), getProperty("mysql_password"));
	me.add(c3p0Plugin);
	
	ActiveRecordPlugin arp = new ActiveRecordPlugin(c3p0Plugin);
	me.add(arp);
}
 
开发者ID:glaciall,项目名称:jfinal-dbx,代码行数:11,代码来源:TestConfig.java


示例4: configPlugin

import com.jfinal.plugin.c3p0.C3p0Plugin; //导入依赖的package包/类
public void configPlugin(Plugins me) {
	
	// 配置缓存插件
	EhCachePlugin ecp = new EhCachePlugin();
	me.add(ecp);

	
	// 配置C3p0数据库连接池插件
	C3p0Plugin c3p0Plugin = new C3p0Plugin(getProperty("jdbcUrl"),
			getProperty("userName"), getProperty("password").trim());
	me.add(c3p0Plugin);

	// 配置ActiveRecord插件
	ActiveRecordPlugin arp = new ActiveRecordPlugin(c3p0Plugin);
	me.add(arp);

	//Model自动绑定
	AutoTableBindPlugin atbp = new AutoTableBindPlugin(c3p0Plugin);
	me.add(atbp);

	// 配置任务
	Cron4jPlugin cron4jPlugIn = new Cron4jPlugin();
	me.add(cron4jPlugIn);

	// sqlXml
	SqlInXmlPlugin sqlInXmlPlugin = new SqlInXmlPlugin();
	me.add(sqlInXmlPlugin);

}
 
开发者ID:jaiiye,项目名称:weixin-moffice,代码行数:30,代码来源:WeixinConfig.java


示例5: configPlugin

import com.jfinal.plugin.c3p0.C3p0Plugin; //导入依赖的package包/类
/**
 * 配置插件
 */
@Override
public void configPlugin(Plugins me) {
    c3p0Plugin = new C3p0Plugin(getProperty("jdbcUrl"), getProperty("user"), getProperty("password").trim());
    me.add(c3p0Plugin);

    ActiveRecordPlugin arp = new ActiveRecordPlugin(c3p0Plugin);
    arp.addMapping("re_student", ReStudent.class);
    arp.addMapping("re_class", ReClass.class);
    arp.addMapping("re_rmb", ReRMB.class);
    arp.addMapping("re_admin", AdminUser.class);
    me.add(arp);
}
 
开发者ID:Wccczy,项目名称:Student_Register,代码行数:16,代码来源:WebConfig.java


示例6: configPlugin

import com.jfinal.plugin.c3p0.C3p0Plugin; //导入依赖的package包/类
@Override
public void configPlugin(Plugins me) {

    C3p0Plugin cp = new C3p0Plugin(getProperty("jdbcUrl"), getProperty("user"), getProperty("password"));
    me.add(cp);
    ActiveRecordPlugin arp = new ActiveRecordPlugin(cp);
    me.add(arp);
    arp.addMapping("bee_users", UserModel.class);
    arp.addMapping("bee_tasks",TasksModel.class);
    arp.addMapping("bee_projects",ProjectModel.class);
    arp.addMapping("bee_logs",LogsModel.class);
    arp.addMapping("bee_weekplan", WeekPlanModel.class);
}
 
开发者ID:guangchiguangchi,项目名称:little-bee,代码行数:14,代码来源:JFConfig.java


示例7: getActiveRecordPlugin

import com.jfinal.plugin.c3p0.C3p0Plugin; //导入依赖的package包/类
/**
 * 配置JFinal提供过简易版本的ORM(其实这里是叫Active+Record)。
 *
 * @param c3p0Plugin
 * @return
 */
private ActiveRecordPlugin getActiveRecordPlugin(C3p0Plugin c3p0Plugin) {
    ActiveRecordPlugin arp = new ActiveRecordPlugin("c3p0Plugin" + new Random().nextInt(), c3p0Plugin);
    arp.addMapping("user", "userId", User.class);
    arp.addMapping("log", "logId", Log.class);
    arp.addMapping("type", "typeId", Type.class);
    arp.addMapping("link", "linkId", Link.class);
    arp.addMapping("comment", "commentId", Comment.class);
    arp.addMapping("lognav", "navId", LogNav.class);
    arp.addMapping("website", "siteId", WebSite.class);
    arp.addMapping("plugin", "pluginId", Plugin.class);
    arp.addMapping("tag", "tagId", Tag.class);
    return arp;
}
 
开发者ID:94fzb,项目名称:zrlog,代码行数:20,代码来源:ZrlogConfig.java


示例8: start

import com.jfinal.plugin.c3p0.C3p0Plugin; //导入依赖的package包/类
public static void start() {
    c3p0Plugin = new C3p0Plugin(AppConfig.db.jdbcUrl, AppConfig.db.username, AppConfig.db.password);
    c3p0Plugin.setDriverClass(AppConfig.db.driverClass);
    c3p0Plugin.start();
    activeRecordPlugin = new ActiveRecordPlugin(c3p0Plugin);
    activeRecordPlugin.setDialect(new MysqlDialect());
    activeRecordPlugin.addMapping("user", User.class);
    activeRecordPlugin.addMapping("user_detail", UserDetail.class);
    activeRecordPlugin.addMapping("admin", Admin.class);
    activeRecordPlugin.addMapping("crash_log", CrashLog.class);
    activeRecordPlugin.addMapping("advice", Advice.class);
    activeRecordPlugin.start();
}
 
开发者ID:LNTUORG,项目名称:LNTUOnline-API,代码行数:14,代码来源:DBHelper.java



注:本文中的com.jfinal.plugin.c3p0.C3p0Plugin类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RMDIR3Response类代码示例发布时间:2022-05-22
下一篇:
Java ItemBook类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap