- 博客(50)
- 资源 (20)
- 问答 (1)
- 收藏
- 关注
原创 POI 读取Excel
POI处理Excel 的例子。 1 读取Excel见附件中 ReadExce/src/test/ReadExcel.java 2 写Excel的简单使用: package test3; import java.io.FileOutputStream;import java.util.Date;import org.apache.poi.hssf.userm...
2013-03-31 08:37:23 80
原创 随着页面滚动的导航条
随着页面滚动,底部的导航条也随着滚动 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><HTML> <HEAD> <TITLE>...
2013-03-28 10:24:08 1004
原创 java 时间处理
1 得到相应的 日 月 年 Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.DATE, -1); //得到前一天 calendar.add(Calendar.MONTH, -1); //得到前一个月 int year = ca...
2013-03-25 18:08:14 67
原创 File 类的过滤器(策略模式应用)
用策略模式取出某个目录下的某一类文件 public static void main(String[] args) throws IOException { File file = new File("C:\\Documents and Settings\\dell\\桌面\\newwork"); File[] files1 = file.listFiles(...
2013-03-15 12:48:35 174
原创 JFreeChart的使用
查看下面连接: http://www.cnblogs.com/xingyun/archive/2012/02/05/2339237.html
2013-03-15 12:47:39 59
原创 spring整合ibatis
通过SqlMapClientTemplate来操纵数据库的CRUD是没有问题的,这里面关键的问题是事务处理。Spring提供了强大的声明式事务处理的功能,我们已经清楚hibernate中如何配置声明式的事务,那么在iBATIS中如何获得声明式事务的能力呢? 第一,我们需要了解的是spring通过AOP来拦截方法的调用,从而在这些方法上面添加声明式事务处理的能力。典型配置如下:appl...
2013-03-15 12:47:00 66
原创 spring 属性文件加载
#jdbc.driverClassName=com.mysql.jdbc.Driver #jdbc.url=jdbc:mysql://localhost/jbpmtest#jdbc.username=root#jdbc.password=root jdbc.driverClassName=oracle.jdbc.driver.OracleDriverjdbc.url...
2013-03-15 12:46:38 73
原创 linux压缩与解压缩命令
tar 解压缩命令tar -c: 建立压缩档案-x:解压-t:查看内容-r:向压缩归档文件末尾追加文件-u:更新原压缩包中的文件 这五个是独立的命令,压缩解压都要用到其中一个,可以和别的命令连用但只能用其中一个。下面的参数是根据需要在压缩或解压档案时可选的。 -z:有gzip属性的-j:有bz2属性的-Z:有compress属性的-v:显示...
2013-03-15 12:46:24 68
原创 spring DAO支持
Spring为不同持久化技术所提供的模板类 Spring为各种支持的持久化技术都提供了简化操作的模板和回调,在回调中编写具体的数据操作逻辑,使用模板执行数据操 作,在Spring中,这是典型的数据操作模式。下面,我们来了解一下Spring为不同的持久化技术所提供的模板类。 表 3 不同持久化技术对应的模板类 ORM持久化技术 模板类 ...
2013-03-14 17:49:24 91
原创 hibernate 配置文件的一些参数理解
很多Hibernate映射元素定义了可选的length、precision 或者 scale属性。你可以通过这个属性设置字段的长度、精度、小数点位数。 Oracle使用标准、可变长度的内部格式来存储数字。这个内部格式精度可以高达38位。 NUMBER数据类型可以有两个限定符,如: column NUMBER ( precisi...
2013-03-14 17:49:10 102
原创 观察者模式
个人理解:就是一个类拥有另一个类的引用 ,其中前者是被观察者,后者是观察者 当被观察者发生状态改变的时候,观察者发生变化。 1 观察者接口public interface Watcher { public void update( String str);} 2 观察者接口的实现类 public class ConcreateWatcher im...
2013-03-14 17:48:42 70
原创 http协议
经典的http协力理解: http://www.cnblogs.com/TankXiao/archive/2012/02/13/2342672.html
2013-03-14 16:27:19 72
原创 Fiddler 教程(http 消息截获工具)
经常用到的是IE中的http watch和火狐的firbug ,今天找到另一个更强大的工具Fiddler,在这里做个记载。Fiddler的官方网站: www.fiddler2.com 具体使用参考: http://www.cnblogs.com/TankXiao/archive/2012/02/06/2337728.html composer工具使...
2013-03-14 15:27:24 182
原创 装饰者模式
个人理解装饰着模式作用: 1) 有一个基本功能的实现类 2) 需要向基本功能添加的附属功能 Component:抽象出的主体对象。ConcreteComponent:是要动态扩展的对象,它继承自Component.Decorator:是装饰器的接口。(这里的接口并不是指java的interface)。ConcreteDecoratorA:实...
2013-03-13 14:55:45 71
原创 策略模式
工厂模式:创建接口抽象类,类等的对象。外观模式:1 让外部客户端减少子系统内多个模块的交互,(多个类或接口的组合逻辑写到Facede中) 。 2 选择性暴漏子系统内部的接口 适配器:模式:转换匹配,复用功能 。 组合模式:强调部分与整体 ,最后组成树形结构 。单例模式:整个系统只有一个单独实例,减小内存占用 。生成器模式:...
2013-03-13 14:55:07 66
原创 TcpClient与TcpServer
1 Client 测试public class TcpClient { public static void main(String[] args) { try { Socket socket = new Socket("10.10.53.102", 8888); BufferedWriter bw = new BufferedWriter(n...
2013-03-13 14:54:47 779
原创 产品工作中的沟通与协调
1)明确目标: 会议室及电话会议,开会前列出会议章程(最好可以先发个邮件或者打个招呼,告之这次参会人员的大概情况),会议后要有会议结果(及时输出会议纪要)。 会议纪要可以包含下面几个部分: 1.参会人员、日期、时间 2.会议议题(讨论要点) 3.会议纪要(讨论过程的概括及描述) 4.后续策略及关键事件跟踪(后续事件及对应负责人和时间点) 2)换位思考: ...
2013-03-13 14:53:47 183
原创 nginx rewrite学习
实际工作中 有的时候需要将一个项目的访问接口转移到另一个项目中,这时候就需要在原来的项目中做转发,如果服务器是Ngnix的话可以用rewrite 来实现此功能。 重启:nginx 1. 如果是平滑的重启nginx,可以用./nginx -s reload命令实现nginx的平滑重启。2. 如果是非平滑重启,则可以先停止nginx,然后再启动:./nginx -s s...
2013-03-13 14:40:08 239
原创 Map 的两种遍历方式
方法一 HashMap map = new HashMap(); map.put("a", "zhangsan"); map.put("b", "lisi"); map.put("c", "wangwu"); System.out.println( map ); Set set =
2013-03-11 10:11:04 121
原创 java中泛型的学习
1 自定义类使用泛型类作为参数: //T是一个模板 相当于 一个类传到类中 (当使用时候传进来什么类型,这个T就是什么类型) 这里的T后面也可以加上一个V 即两个模板的泛型类public class FanXing<T> { //定义成员变量T private T foo; //得到类型T对象 public T getFoo() { re...
2013-03-11 10:02:24 78
原创 URL类 读取一个网页到本地
1 URL 访问网络资源 URL url = new URL("http://www.infoq.com"); InputStream is = url.openStream(); OutputStream os = new FileOutputStream("c:/text.txt"); byte[] buffer = new byte[2048];...
2013-03-11 09:49:25 113
原创 spring整合hibernage配置
class下面两种类都能实现:1 org.springframework.orm.hibernate3.LocalSessionFactoryBean 2 org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean 注解形式配置session工场 <!--Hiber...
2013-03-10 09:30:13 89
原创 hibernate 主键生成策略
Hibernate中,<id>标签下的可选<generator>子元素是一个Java类的名字,用来为该持久化类的实例生成惟一标示,所有的生成器都实现net.sf.hibernate.id.IdentifierGenerator接口这是一个非常简单的接口,某些应用程序可以选择提供它们自己的特定实现当然,Hibernate提供了很多内置的实现下面是一些内置主键生成器(Key...
2013-03-10 09:29:56 88
原创 spring 提供的基础工具类
文件资源操作文件资源的操作是应用程序中常见的功能,如当上传一个文件后将其保存在特定目录下,从指定地址加载一个配置文件等等。我们一般使用 JDK 的 I/O 处理类完成这些操作,但对于一般的应用程序来说,JDK 的这些操作类所提供的方法过于底层,直接使用它们进行文件操作不但程序编写复杂而且容易产生错误。相比于 JDK 的 File,Spring 的 Resource 接口(资源概念的描...
2013-03-10 09:29:14 181
原创 struts2 文件上传
html <form name="form1" action="lec_uploadFile.action" method="post" enctype="multipart/form-data"> <table> <tr> <td>file<
2013-03-10 09:28:58 63
原创 spring与web.xml相关配置
<!-- 指定spring字符过滤器 --> <filter> <filter-name>SetCharacterEncoding</filter-name> <filter-class> org.springframework.web.filter.CharacterEncod...
2013-03-10 09:28:40 79
原创 dom4j读取XML详解
DOM4J应用 DOM4J是dom4j.org出品的一个开源XML解析包,它的网站中这样定义: Dom4j is an easy to use, open source library for working with XML, XPath and XSLT on the Java platform using the Java Collections Framework ...
2013-03-09 19:09:03 91
原创 jxl自己使用
工具类的下载地址: http://www.andykhan.com/jexcelapi/download.html 工具类的使用: public class JxlUtil { /** * 将一个二维数组的数据写到excel文件中 * @param filepath * @par...
2013-03-09 19:08:37 65
原创 css自动换行
css之自动换行 自动换行问题,正常字符的换行是比较合理的,而连续的数字和英文字符常常将容器撑大,挺让人头疼,下面介绍的是CSS如何实现换行的方法 对于div,p等块级元素 正常文字的换行(亚洲文字和非亚洲文字)元素拥有默认的white-space:normal,当定义的宽度之后自动换行html<div id="wrap">正常文字的换行(亚洲文字和...
2013-03-09 19:08:22 81
原创 sql case wen then 行转列
以下sql是作为参考的sql 统计每个学生的得分情况 :1 创建数据表的脚本 USE [testDB]GO/****** 对象: Table [dbo].[tb] 脚本日期: 03/08/2013 16:42:35 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOSET ANSI_...
2013-03-09 19:08:11 290
原创 java 工程路径的获取
一 相对路径的获得 说明:相对路径(即不写明时候到底相对谁)均可通过以下方式获得(不论是一般的java项目还是web项目) String relativelyPath=System.getProperty("user.dir"); 上述相对路径中,java项目中的文件是相对于项目的根目录 web项目中的文件路径视不同的web服务器不同而不同(tomcat...
2013-03-09 19:07:40 97
原创 ClassLoader的理解
ClassLoader一个经常出现又让很多人望而却步的词,本文将试图以最浅显易懂的方式来讲解 ClassLoader,希望能对不了解该机制的朋友起到一点点作用。 要深入了解ClassLoader,首先就要知道ClassLoader是用来干什么的,顾名思义,它就是用来加载Class文件到JVM,以供程序使用的。我们知道,java程序可以动态加载类定义,而这个动态加载的机制就...
2013-03-08 14:28:10 63
原创 一些有用的sql整理
update user set password=password('oJJX1111122#') where user='root' ; 1 两张表之间数据的转移同一数据库:如果2张表的字段一致,并且希望插入全部数据,可以用这种方法:INSERT INTO 目标表 SELECT * FROM 来源表;比如要将 articles 表插入到 newArti...
2013-03-08 12:05:13 96
原创 jquery 选择器使用参考
基本选择器:$("#myELement") 选择id值等于myElement的元素,id值不能重复在文档中只能有一个id值是myElement所以得到的是唯一的元素$("div") 选择所有的div标签元素,返回div元素数组$(".myClass") 选择使用myClass类的css的所有元素$("*...
2013-03-08 11:59:31 67
原创 nginx 配置文件例子
第一种配置 nginx 上传最大限制为1M,如果有上传文件功能注意修改上传最大值。 #user nobody;worker_processes 1; #error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log info; ...
2013-03-08 11:45:19 98
原创 hibernate 查询返回列表
1.使用SQLQuery对原生SQL查询执行的控制是通过SQLQuery接口进行的,通过执行Session.createSQLQuery()获取这个接口。最简单的情况下,我们可以采用以下形式:List cats = sess.createSQLQuery( " select * from cats " ).addEntity(Cat. class ).list();这个查询指定了:...
2013-03-08 09:25:03 871
原创 hibernate 数据类型对应
integer, long, short, float, double, character, byte, boolean, yes_no, true_false 这些类型都对应 Java 的原始类型或者其封装类,来符合(特定厂商的)SQL 字段类型。 boolean, yes no 和 true false 都是 Java 中 boolean 或者 java.lang....
2013-03-07 17:37:11 142
power designer 15破解文件
2012-11-23
jquery-validation 校验框架
2012-06-04
WebLogicServer11gCluster_SingleMachine.rar
2011-10-11
Expert One-on-One J2EE Design and Development
2011-10-11
overflow 溢出部分不隐藏
2013-07-22
TA创建的收藏夹 TA关注的收藏夹
TA关注的人