Log4j配置

摘要: 2011-03-11 13:19:35,421 ERROR (com.tq365.samples.util.MyAspect:37) - Oops===com.tq365.samples.ibatis.dao.UserDAOimpl中的addUser方法抛出/ by zero异常日志文件log4j.properties## Log4J Settings for log4j 1.2.x (via jakarta-commons-logging)## The five logging levels used by Log are (in order):## 1. DEBUG (the least 阅读全文
posted @ 2011-03-11 13:10 archie2010 阅读(499) 评论(0) 推荐(0) 编辑

JfreeChart折线图

摘要: 截图package com.tq365.chart;import java.awt.Color;import java.awt.Dimension;import java.io.IOException;import java.io.PrintWriter;import java.text.SimpleDateFormat;import javax.servlet.http.HttpSession;import javax.swing.JPanel;import org.jfree.chart.*;import org.jfree.chart.axis.DateAxis;import org.j 阅读全文
posted @ 2011-03-09 13:38 archie2010 阅读(4841) 评论(1) 推荐(0) 编辑

java把double转化为long型

摘要: 用Double封装下基本类型double,再调用longValue方法Double(double value) long longValue() 将此 Double 值作为 long 类型返回(通过强制转换为 long 类型)。 double random=Math.round(Math.random()*10000); long l = new Double(random).longValue(); 阅读全文
posted @ 2011-03-04 15:04 archie2010 阅读(21398) 评论(0) 推荐(0) 编辑

Ibatis,Spring整合(注解方式注入)

摘要: applicationContext.xml<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context=&quo 阅读全文
posted @ 2011-03-03 14:56 archie2010 阅读(16911) 评论(2) 推荐(1) 编辑

MyBatis3入门样例

摘要: User.javapackage com.archie.domain;import java.io.Serializable;@SuppressWarnings("serial")public class User implements Serializable{ private int uid; private String uname; private String upwd; public int getUid() { return uid; } public void setUid(int uid) { this.uid = uid; } public String 阅读全文
posted @ 2011-03-02 18:27 archie2010 阅读(1361) 评论(0) 推荐(0) 编辑

MyBatis3 SqlSessionFactory

摘要: SqlSessionFactoryBuilder:用于建立SqlSessionFactory的工具类,在创建 SqlSessionFactory以后无需再让它存在于应用程序中,文档上说它的生命周期最好在局部方法内,所以在代码中看到//根据资源文件内容建立session工厂SqlSessionFactory sqlMapper = new SqlSessionFactoryBuilder().build(reader);没用引用指向 SqlSessionFactoryBuilder,会被gc回收。SqlSessionFactory:一旦建立,SqlSessionFactory就应该存在于整个应用 阅读全文
posted @ 2011-03-02 14:33 archie2010 阅读(1585) 评论(0) 推荐(0) 编辑

struts2 ibatis Spring系统架构图

摘要: struts2 Ibatis Spring ----------------------------------- 阅读全文
posted @ 2011-02-25 11:38 archie2010 阅读(1505) 评论(2) 推荐(1) 编辑

Spring中的autowire属性(转)

摘要: default-autowire="x"x有4个选择:byName,byType,constructor和autodetect1. byName:Service.javapublic class Service{ Source source; public void setSource(Source source) { this.source = source; }}applicationContext.xml<beans ... default-autowire="byName"> <bean id="source" 阅读全文
posted @ 2011-02-22 15:21 archie2010 阅读(1656) 评论(0) 推荐(0) 编辑

sql server远程连接非1433端口

摘要: 服务器名称:192.168.1.6,1455 阅读全文
posted @ 2011-02-16 15:03 archie2010 阅读(346) 评论(0) 推荐(0) 编辑

StringUtils工具类

摘要: 1 abbreviate方法 缩写一段文字 Java代码 StringUtils.abbreviate("abcdefghijklmno",-1,10)="abcdefg..."2 isBlank和isEmpty区别 Java代码 StringUtils.isBlank("")=trueStringUtils.isEmpty("")=false3 join方法 Java代码 StringUtils.join(["a","b","c"],"--&q 阅读全文
posted @ 2011-02-14 09:46 archie2010 阅读(2618) 评论(0) 推荐(2) 编辑