- 浏览: 44541 次
- 性别:
- 来自: 杭州
最新评论
-
zhang2008081110:
是不是jdk的版本原因?我的是1.5,也试过1.6,还是不得行 ...
ha-jdbc入门demo -
zhang2008081110:
为什么我跑不起来.?报错:Error creating bea ...
ha-jdbc入门demo -
sd_zyl:
引用你的DEMO 我下载也做了测试。结果只有zyl中有一笔数据 ...
ha-jdbc入门demo -
zhuyun_321:
你好,sd_zyl 你的DEMO 我下载也做了测试。结果只有z ...
ha-jdbc入门demo
文章列表
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import com.google.common.base.Function;
import com.google.common.collect.Multimap;
import com.google.common.collect.Multimaps;
import lombok.Getter;
import lombok.Setter;
@Setter
...
JAVA_OPTS="-server -XX:PermSize=128m -XX:MaxPermSize=128m -Xmn512m -Xms1024m -Xmx1024m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:CMSFullGCsBeforeCompaction=3 -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -XX:SurvivorRatio=8 -XX:+HeapDumpOnOutOfMe ...
1:增加javamelody依赖
<dependency>
<groupId>net.bull.javamelody</groupId>
<artifactId>javamelody-core</artifactId>
<version>1.57.0</version>
</dependency>
2:web.xml配置增加
<listener>
<listener-class>net.bull.javamelody.Se ...
查看索引大小:
use information_schema;
select
concat(round(sum(index_LENGTH)/(1024*1024),2),'MB') as 'Index Size(MB)',
index_LENGTH as 'Index Size(Bytes)'
from tables
where table_schema='my_db' and table_name='table_name';
重建索引(MyISAM下面语句有效;innodb下面语句无效,需要先删除索引,然后重建):
use my_db;
REPAIR T ...
public class Feeder {
public void feed(Animal animal) {
System.out.println("feed Animal.");
}
public void feed(Dog dog) {
System.out.println("feed Dog: " + dog.eat());
}
public void feed(Cat cat) {
System.out.println("feed Cat: " + cat.eat());
}
} ...
@Resource
private Scheduler startQuertz;//这个需要注入过来
/**
* 更新定时任务的运行时间
* @param triggerKey 定时任务在spring里配置bean的id
* @param cronExpression 定时器的cron表达式
* @param executeNow 默认值为0,不要立即执行定时任务一次; 非0值表示立即执行一次
* @return
*/
public boolean updateCronE ...
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
class TaskOne implements Callable<String> {
// 模拟中间人,存放任务结果
private StringBuilder sb;
pu ...
create table OPT_LOG
(
opercontent VARCHAR2(500)
)
alter table opt_log add tmp_opercontent clob;
update opt_log s set s.tmp_opercontent = s.opercontent;
commit;
alter table opt_log drop column opercontent;
alter table opt_log rename column tmp_opercontent to opercontent;
//当前日期
DateTime begin = DateTime.now();
//在begin的基础上增加4天
DateTime end = begin.plusDays(4);
//计算区间天数
Period pe = new Period(begin, end, PeriodType.days());
int days = pe.getDays();
System.out.println(days);
//格式化yyyyMMdd字符串
...
java多线程版本:
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
class Athlete implements Runnable {
private final int id;
private Game game;
public Athlete(int id, Game game) {
this.id ...
今天看hessian(版本4.0.7)调用源码时候发现com.caucho.hessian.server.HessianServlet的service方法有以下几句:
HttpServletRequest req = (HttpServletRequest) request;
HttpServletResponse res = (HttpServletResponse) response;
if (!req.getMethod().equals("POST")) {
res.sendError(500, "Hessian Requir ...
只是一个图片,下面有用powerdesign画的原件
1:SqlMapClient为单例对象。客户端每次请求, SqlMapClient都要生成一个SqlMapSession对象的一个实例。在生成SqlMapSession实例过程中,SqlMapSession通过构造函数参数引用SqlMapClient单例对象,这样形成多个SqlMapSession都引用同一个SqlMapClient
2:SqlMapSession实例通过引用SqlMapClient获取了SqlMapExecutorDelegate单例对象,同时使用这个SqlMapExecutorDelegate对象构造出了另一个轻量级 ...
先看段经典的ibatis spring配置,注意我的配置中没有配置spring的声明式事务:
<!-- ======================================================================== -->
<!-- DataSource定义。 -->
<!-- ======================================================================== -->
<bean ...
有时候您可能需要自己动手写一些工具类在view层进行使用,类似jstl函数在jsp页面中使用,(关于jstl函数,相信做java的开发人员基本都用过),下面介绍一种在spring mvc中将工具类导出在view层使用的另一种方式,功能很容易,实现也简单,在此记录下。
类org.springframework.web.servlet.view.UrlBasedViewResolver提供了2个方法:
public void setAttributes(Properties props) {
CollectionUtils.mergePropertiesIntoMap(props, th ...
最近两天闲暇时候,对activemq做了入门研究,以下心得:
发送消息可以做持久化,非持久化不能保证可靠性,不考虑。持久化分为下面3种。
1. AMQ Message Store
AMQ Message Store是ActiveMQ 5.0 缺省的持久化存储
Message commands被保存到transactional journal(由rolling data logs组成)。
Messages被保存到data logs中,同时被reference store进行索引以提高存取速度。
Date logs由一些单独 ...