ITeye博客

埋醉姆

prodream · 共 86 篇文章

java 内存机制(堆和栈)内存地址

问题的引入: 问题一: String str1 = "abc"; String str2 = "abc"; System.out.println(str1==str2); //true 问题二: String str1 =new String ("abc"); String str2 =new String ("abc"); System.out.println(str1==str2); // false 问题三: String s1 = "ja"; String s2 = "va"; String s3 = "java"; String s4 = s1 + s2; System.out.p…

2010-07-30 10:34 · 评论(0)

freemarker用于生成sql语句实例

private static Configuration NAMEDSQL_CONFIG = new Configuration(); private static StringTemplateLoader NAMEDSQL_STL = new StringTemplateLoader(); static { NAMEDSQL_CONFIG.setTemplateLoader(NAMEDSQL_STL); } /** * 获取处理之后的命名SQL。定义命名SQL的文件名:类名.xml,命名SQL以freemarker模板方式定义。 * @param clz * @param sqlId * …

2010-07-05 14:29 · 库 · 评论(0)

freemarker运用实例

import java.io.InputStream; import java.io.StringWriter; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.commons.io.IOUtils; import org.dom4j.Document; import org.dom4j.DocumentHelper; import org.dom4j.Element; import freemarker.cache.StringTemplateLoader; i…

2010-07-05 14:22 · 库 · 评论(0)

Quartz介绍及实例

Quartz是OpenSymphony开源组织在Job scheduling领域又一个开源项目,它可以与J2EE与J2SE应用程序相结合也可以单独使用。Quartz可以用来创建简单或为运行十个,百个,甚至是好几万个Jobs这样复杂的日程序表。Jobs可以做成标准的Java组件或 EJBs。 实例: package example.quartz; import org.quartz.CronTrigger; import org.quartz.Job; import org.quartz.JobDetail; import org.quartz.JobExecutionContext; imp…

2010-05-06 19:43 · 评论(0)

spring-MessageSource

将Spring自带的org.springframework.context.support.ResourceBundleMessageSource类注册到bean.xml中,这个类的作用是获取资源文件的内容,注册到IoC的bean.xml文件中是为了自动获得此类的对象(Spring做了一些简化编程的处理)。 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <…

2010-05-05 15:41 · Spring · 评论(0)

spring的扩展点--PropertyPlaceholderConfigurer

它的作用是一个资源属性的配置器,能够将BeanFactory的里定义的内容放在一个以.propertis后缀的文件中. 要了解这个类首先要弄清楚一个概念:bean factory post-processor 官方解释是这样的: A bean factory post-processor is a java class which implements the org.springframework.beans.factory.config.BeanFactoryPostProcessor interface. It is executed manually (in the case of …

2010-05-05 14:01 · Spring · 评论(0)

apache-commons-beanutils学习

前言:掌握apache的commons的常用的工具后,你会发现开发起来顺手多了... 一.框架介绍 beanutils主要用来处理java bean 开发包,提供java反射和API自省的包装。 二.使用场景 对表单的处理,jdbc后的数据 三.运用 1.属性值读取,写入 PropertyUtils.getSimpleProperty(Object bean, String name) PropertyUtils.setSimpleProperty(Object bean, String name, Object value) 但我更喜欢Ognl...方便.简单,支持复杂的结构(当然bean…

2010-04-30 17:54 · 评论(0)

数据库的查询优化技术,设计

数据库设计三大范式应用实例剖析 http://dev.yesky.com/424/2220924.shtml 数据库的查询优化技术 http://www.moon-soft.com/download/info/1674.htm 浅谈数据库设计技巧(上) http://www.moon-soft.com/download/info/1587.htm 浅谈数据库设计技巧(下) http://www.moon-soft.com/download/info/1588.htm

2010-04-27 21:27 · 评论(0)

POI的简单封装

在一次开发中,需要做excle数据导入。 开发中我发现,将一列作为一个对象来进行处理,可以大大的方便程序的操作. package com.wac.business.filedataconvey.excle; import ognl.Ognl; import ognl.OgnlException; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import or…

2010-04-27 16:06 · 评论(0)

struts使用freemarker的简单实例

1.Bean public class User { private int userId; private String userName; public int getUserId() { return userId; } public void setUserId(int userId) { this.userId = userId; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } } 2. …

2010-04-21 22:23 · 评论(0)

使用freemarker生成sql实例

1.使用freemarket 生成sql语句 Index.xml: <?xml version="1.0" encoding="UTF-8"?> <sqls> <sql id="queryAccountTransfers"><![CDATA[ <#assign where> <#if date??> and transferTime>=:date </#if> <#if date_end??> and transferTime<=:date_end </#if> <#if money??> and srcMoney>=:money </#if> <#if money_end??> and s…

2010-04-21 20:29 · 评论(0)

MYSQL批量插入数据的实现以及存储/函数介绍

http://www.jb51.net/article/16148.htm

2010-04-19 15:04 · 评论(0)

spring事务配置实例<2>拦截式

<!-- transaction --> <bean name="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory"></property> </bean> <!-- 配置事务拦截bean --> <bean id="transactionInterceptor" class="org.springframework.transaction.intercep…

2010-03-30 16:38 · Java · 评论(0)

==与equals区别

==比较的是 reference--"引用",即地址 Object 的equals(Object o)方法 直接使用的 == 例如: String a="aa"; String b="aa"; String c=a; 则以下结论成立: a!=b; b!=c; a==c; a.equals(b)==true a.equals(c)==true 需要注意的是 String 对equals()进行了重构,它返回true,则说明两字符串内容一样,而不是说明地址一样!

2010-03-30 16:33 · 评论(0)

spring事务配置实例<1>

<bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource" /> </bean> <aop:config proxy-target-class="true"> <aop:pointcut id="transactionOperation" expression="execution(* com.oa..*Facade.*(..))" /> <aop:advisor advic…

2010-03-30 15:51 · 评论(0)