maven dubbo

好用的maven工具intelligent java (IntelliJ IDEA 15.0)网上有破解方法,用程序生成破解码

注意官方的dubbox底下很多的文件夹都是有用的,要一起编译。

简介参考http://www.cnblogs.com/yjmyzz/p/dubbox-demo.html 要不我一会把这篇转载过来。

<pre name="code" class="java">private int initialSize = 10;
	private int minIdle = 10;
	private int maxActive = 100;
	private long maxWait = DruidDataSource.DEFAULT_MAX_WAIT;

	// 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
	private long timeBetweenEvictionRunsMillis = DruidDataSource.DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS;
	// 配置连接在池中最小生存的时间
	private long minEvictableIdleTimeMillis = DruidDataSource.DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS;
	// 配置发生错误时多久重连
	private long timeBetweenConnectErrorMillis = DruidDataSource.DEFAULT_TIME_BETWEEN_CONNECT_ERROR_MILLIS;
	private String validationQuery = "select 1";
	private boolean testWhileIdle = true;
	private boolean testOnBorrow = false;
	private boolean testOnReturn = false;

	// 是否打开连接泄露自动检测
	private boolean removeAbandoned = false;
	// 连接长时间没有使用,被认为发生泄露时长
	private long removeAbandonedTimeoutMillis = 300 * 1000;
	// 发生泄露时是否需要输出 log,建议在开启连接泄露检测时开启,方便排错
	private boolean logAbandoned = false;

public String hello(String name) { if(init==false){// dp= new DruidPlugin("jdbc:mysql://*****/ocr?characterEncoding=utf8",// "ocr", "*****","com.mysql.jdbc.Driver", "stat");// dp.setMaxActive(10);// dp.setMaxPoolPreparedStatementPerConnectionSize(10); arp= new ActiveRecordPlugin(new IDataSourceProvider() {@Overridepublic DataSource getDataSource() {DruidDataSource ds = new DruidDataSource();ds.setUrl(url);ds.setUsername(username);ds.setPassword(password);if (driverClass != null)ds.setDriverClassName(driverClass);ds.setInitialSize(initialSize);ds.setMinIdle(5);ds.setMaxActive(maxActive);ds.setMaxWait(maxWait);ds.setTimeBetweenConnectErrorMillis(timeBetweenConnectErrorMillis);ds.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);ds.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);ds.setValidationQuery(validationQuery);ds.setTestWhileIdle(testWhileIdle);ds.setTestOnBorrow(testOnBorrow);ds.setTestOnReturn(testOnReturn);ds.setRemoveAbandoned(removeAbandoned);ds.setRemoveAbandonedTimeoutMillis(removeAbandonedTimeoutMillis);ds.setLogAbandoned(logAbandoned);//只要maxPoolPreparedStatementPerConnectionSize>0,poolPreparedStatements就会被自动设定为true,参照druid的源码ds.setMaxPoolPreparedStatementPerConnectionSize(10);// if (StrKit.notBlank(filters))// try {ds.setFilters(filters);} catch (SQLException e) {throw new RuntimeException(e);}// addFilterList(ds);return ds;}});// arp.addMapping("ocr_user","user_id", User.class); // 与web环境唯一的不同是要手动调用一次相关插件的start()方法// dp.start(); arp.start(); init=true; } // 通过上面简单的几行代码,即可立即开始使用 //new Blog().set("title", "title").set("content", "cxt text").save(); //User.dao.findById(1);// User user = User.dao.findById (1);// String session = user.getStr("session_key"); Date date=Db.queryDate("select now()");Record session = Db.findFirst("select session_key from ocr_user where user_id = 3");//String s="aa"; return "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"+date+"hello " + name+" "+session.getStr("session_key"); }
 

上面代码可以在dubbo中用于jfinal


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值