code-fragment
文章平均质量分 68
topinking
这个作者很懒,什么都没留下…
展开
-
POI代碼
遍歷Excel文件:FileInputStream fileInputStream = new FileInputStream( "c:/temp/test.xls" ); POIFSFileSystem fileSystem = new POIFSFileSystem( fileInputStream ); fileInputStream.close(); HSSFWorkbo...2008-07-11 18:54:10 · 95 阅读 · 0 评论 -
send email with velocity and spring 完整示例
http://chenlb.blogjava.net/archive/2007/08/21/138437.htmlsend email with velocity and spring 完整示例 由于项目里要发邮件,用了spring 和 velocity 模板。写下来以后可以看,好记性不如博客。版本说明下:spring 2.0.6velocity 1.5javamail 用 sprin...原创 2008-09-17 10:17:16 · 83 阅读 · 0 评论 -
Spring ActionFactory
public class ActionFactory { public static Action getAction(String actionName) { Properties cfgFile = new Properties(); try { cfgFile.load(new FileInputStream(ActionFactory.class.getResource...2008-09-09 16:25:43 · 126 阅读 · 0 评论 -
spring ServiceUtil
public class ServiceUtil { private static final ApplicationContext appCtx = new ClassPathXmlApplicationContext( "META-INF/springbeans.xml"); public static Object getService(Class t) { return ...2008-09-09 16:18:05 · 115 阅读 · 0 评论 -
springbeans.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" xsi:schemaLocation="2008-09-09 16:09:00 · 209 阅读 · 0 评论 -
java处理日期时间
关键字: java处理日期时间JAVA处理日期时间常用方法: 1.java.util.Calendar Calendar 类是一个抽象类,它为特定瞬间与一组诸如 YEAR、MONTH、DAY_OF_MONTH、HOUR 等 日历字段之间的转换提供了一些方法,并为操作日历字段(例如获得下星期的日期)提供了一些方法。瞬间可用毫秒值来表示,它是距历元(即格林威治标准时间 1970 年 1 月 1 日的...原创 2008-09-05 10:05:10 · 121 阅读 · 0 评论 -
upload code
package org.uploadtag.servlet;import java.io.IOException;import java.util.List;import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletR...原创 2008-07-30 19:31:53 · 183 阅读 · 0 评论 -
英文月份和数字月份转换
public static List<String> MONTH_LIST = Arrays.asList("JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV"2008-07-25 15:00:34 · 5264 阅读 · 0 评论 -
XmlUnitTest
public class XmlUnitTest extends XMLTestCase { public XmlUnitTest( String name ) { super( name ); } public void testForEquality() throws Exception { String myControllerXML = "<msg><...2008-07-18 14:46:21 · 125 阅读 · 0 评论 -
DBUTILS
public static void main(String[] args) throws SQLException, ClassNotFoundException { Class.forName("org.apache.derby.jdbc.ClientDriver"); Connection jdbcConnection = DriverManager.getConnection("j...2008-07-18 14:41:05 · 71 阅读 · 0 评论 -
JAVA DOUBLE 格式化
public class Demo { /** * @param args */ public static void main( String[] args ) { double d = 3.262724538037E-4; DecimalFormat df = new DecimalFormat( "#.################" ); System.out...2008-07-18 12:29:33 · 1332 阅读 · 1 评论 -
list/Arrays/Set之间的转换
http://blog.csdn.net/qianling3439/archive/2008/08/01/2752475.aspx ★ 数组转Collection使用Apache Jakarta Commons Collections:import org.apache.commons.collections.CollectionUtils; String[] strAr...原创 2008-09-18 10:32:52 · 75 阅读 · 0 评论