- 博客(81)
- 资源 (6)
- 收藏
- 关注
原创 mysql根据出生日期统计年龄段
select nnd as '年龄段',count(*) as '人数' from( select case when (year(now())-year(birthday)-1) + ( DATE_FORMAT(birthday, '%m%d') when (year(now())-year(birthday)-1) + ( DATE_FORMAT(birth
2017-04-18 17:35:56
7771
原创 单个或者多个jasper文件生成PDF文件
import java.io.ByteArrayOutputStream;import java.io.File;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException;import java.util.ArrayList;import j
2016-10-09 17:08:04
7287
原创 乱码被GZip压缩过的Response进行解压
if(response.containsHeader("Content-Encoding")){ String html = EntityUtils.toString(new GzipDecompressingEntity(response.getEntity())); }
2016-01-15 13:50:34
1076
原创 获取spring容器,以访问容器中定义的其他bean
package com.ihappylife.spring.context;import org.springframework.beans.BeansException;import org.springframework.context.ApplicationContext;import org.springframework.context.ApplicationContextA
2015-08-17 15:00:05
660
转载 https原理及tomcat配置https方法
一、 什么是HTTPS在说HTTPS之前先说说什么是HTTP,HTTP就是我们平时浏览网页时候使用的一种协议。HTTP协议传输的数据都是未加密的,也就是明文的,因此使用HTTP协议传输隐私信息非常不安全。为了保证这些隐私数据能加密传输,于是网景公司设计了SSL(Secure Sockets Layer)协议用于对HTTP协议传输的数据进行加密,从而就诞生了HTTPS。SSL目前的版本是3.0,
2015-03-18 14:40:03
398
原创 javascript B,KB,MB等单位换算
function bytesToSize(bytes) { if (bytes === 0) return '0 B'; var k = 1000, // or 1024 sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB", 'ZB', 'YB'], i = Math.floor(Math.log
2014-11-27 14:34:41
1979
原创 document.execCommand()的用法小记
首先要说明的是在firefox下支持不好。2D-Position 允许通过拖曳移动绝对定位的对象。 AbsolutePosition 设定元素的 position 属性为“absolute”(绝对)。 BackColor 设置或获取当前选中区的背景颜色。 BlockDirLTR 目前尚未支持。 BlockDirRTL 目前尚未支持。 Bold 切换当前选中区的粗体显示与否。
2014-10-14 15:31:59
484
转载 [Java]读取文件方法大全
public class ReadFromFile { /** * 以字节为单位读取文件,常用于读二进制文件,如图片、声音、影像等文件。 */ public static void readFileByBytes(String fileName) { File file = new File(fileName); In
2014-09-25 10:36:46
394
原创 生成myeclipse注册码的java代码
package com.asiansecu.wam.biz.utils;import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Test { private static final String L
2014-09-23 14:22:34
623
转载 漂浮广告,兼容ie、firefox,多个漂浮不冲突,调用只需两行代码
wahaha //公共脚本文件 main.jsfunction addEvent(obj,evtType,func,cap){ cap=cap||false; if(obj.addEventListener){ obj.addEventListener(evtType,func,cap); retur
2014-09-04 18:35:24
851
原创 java文件编码和解码
package com.easy.mytest.util;import java.io.BufferedOutputStream;import java.io.ByteArrayOutputStream;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;
2014-04-29 11:52:34
675
原创 Spring 的Hibernate事务管理机制 .
一、事务的隔离级别使用Spring 声明式事务时,有一个非常重要的概念就是事务属性。事务属性通常由事务的传播行为,事务的隔离级别,事务的超时值和事务只读标志组成。org.springframework.transaction包里面的TransactionDefinition类getTimeout()方法,它返回事务必须在多少秒内完成。 isReadOnly(),事务是否只读,事务管
2014-04-03 15:29:32
565
原创 Spring Annotation 详解
(1) 、 该配置隐式注册了多个对注解进行解析的处理器,如: AutowiredAnnotationBeanPostProcessor CommonAnnotationBeanPostProcessor PersistenceAnnotationBeanPostProcessor RequiredAnnotationBeanPostProcessor
2014-04-03 15:08:46
455
原创 Hibernate缓存
Hibernate缓存的作用:Hibernate是一个持久层框架,经常访问物理数据库,为了降低应用程序对物理数据源访问的频次,从而提高应用程序的运行性能。缓存内的数据是对物理数据源中的数据的复制,应用程序在运行时从缓存读写数据,在特定的时刻或事件会同步缓存和物理数据源的数据Hibernate缓存分类:Hibernate缓存包括两大类:Hibernate一级缓存和Hibernate二级缓
2014-03-10 10:47:39
475
原创 接口流以字符串的形式返回
import org.jdom.CDATA;import org.jdom.Document;import org.jdom.Element;import org.jdom.output.Format;import org.jdom.output.XMLOutputter;public class T { public String Test() { // 创建根
2014-03-03 16:33:32
1340
原创 oracle分页
select * from (select rownum rownum1, t.* from (select * from g_infos) t where rownum 10 * (27 - 1) ;
2014-02-26 11:34:42
469
原创 java上传FTP
package com.fangdi.landaudit.process.util;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.IOException;import java.io.InputStream;impo
2014-02-24 15:00:45
433
原创 导出Excel
function exe(){ $.ajax({ type:'post', url:m_strContextPath+'action?searchHelperAction=2', dataType:'text', contentType :"application/x-www-form-urlencoded; char
2014-02-24 11:19:19
496
原创 Struts2和Strtus1.x进行全面的比较
为了对Struts2和Strtus1.x进行全面的比较,让读者了解这两种框架各自的优缺点,以便于在自己的项目中,根据实际情况,选择合适的框架,对它们两者进行比较,总结了如下表分析比较。特性Struts1.xStruts2Action类Struts1.x要求Action类要扩展自一个抽象基类。Struts1.x的一个共有
2014-02-17 15:53:16
472
转载 SSH框架总结
首先,SSH不是一个框架,而是多个框架(struts+spring+hibernate)的集成,是目前较流行的一种Web应用程序开源集成框架,用于构建灵活、易于扩展的多层Web应用程序。 集成SSH框架的系统从职责上分为四层:表示层、业务逻辑层、数据持久层和域模块层(实体层)。 Struts作为系统的整体基础架构,负责MVC的分离,在Struts框架的模型部分,控制业务跳转,利用H
2014-02-17 15:43:13
717
转载 oracle基本操作
总结:什么时候使用连接查询?--当需要显示的数据来源于多个表时,使用连接查询。--一,连接查询--分传统连接与内连接/*1,查询员工姓名和所在部门的名称(2种 )--传统连接 --依赖的是 ,和where*/select * from emp,dept where emp.deptno=dept.deptnoselect ename,dname,emp.de
2014-01-24 10:51:19
622
原创 Oracle分割函数
select length('CR001,CR002,CR003,CR004')-length(replace('CR001,CR002,CR003,CR004',','))+1 from dual;
2013-12-23 19:22:20
625
原创 输入公历得到农历
package com.fangdi.workflow.definition.webService;import java.text.ParseException;import java.text.SimpleDateFormat;import java.util.Calendar;import java.util.Date;import java.util.*;publi
2013-12-13 14:35:39
638
原创 输入公历得到农历
package com.fangdi.workflow.definition.webService;import java.text.ParseException;import java.text.SimpleDateFormat;import java.util.Calendar;import java.util.Date;import java.util.*;publi
2013-12-13 14:33:44
512
原创 输入年份得到当年春节的公历
package com.fangdi.workflow.definition.webService;import java.text.SimpleDateFormat;import java.util.Date;public class Test1 { public static void main(String[] args) { // 调用农历日期转换阳历日期方法
2013-12-13 14:31:58
1039
原创 java操作跳出最外层循环
public static void main (String []args){//外层循环,outer作为标识符outer:for(int i=0;ifor(int j=0;jSystem.out.println(i+"---"+j);//当j=2时结束outer标识符指定的循环if(j==2){break outer;}}}}
2013-12-04 16:36:00
1231
原创 java中判断字符串是否为数字的三种方法
1用JAVA自带的函数public static boolean isNumeric(String str){ for (int i = str.length();--i>=0;){ if (!Character.isDigit(str.charAt(i))){ return false; } } return true; }2用正
2013-12-03 19:53:08
539
原创 java操作文件批量上传
package com.fangdi.landaudit.process.util;import java.io.File;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.PrintWriter;import java.u
2013-11-21 18:01:50
13290
原创 exe文件通过bat文件写到注册表中
@echo offif exist systray.exe goto setreg:setregecho The Installation Directory is %CD%echo.reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v myrun /t REG_SZ /d "
2013-11-20 22:48:12
2435
原创 java日期相加减
import java.util.*; import java.text.*; public class formatDate { public formatDate() { } // 格式化日期为字符串 "yyyy-MM-dd hh:mm"
2013-10-18 14:19:21
3642
原创 MyEclipse6.5注册码_代码
package test;import java.text.DecimalFormat;import java.text.NumberFormat;import java.text.SimpleDateFormat;import java.util.Calendar;public class GetReg { public static final void main(St
2013-10-09 10:22:42
513
转载 Oracle 10g 闪回查询特性的增强
Oracle 10g 闪回查询特性的增强: Oracle 9i提供了闪回特性增强,为数据恢复带来了极大的方便,但是Oracle 9i的闪回查询只能提供某个时间点的数据视图,并不能告诉用户这样的数据经过了几个事务、怎样的修改(UPDATE、INSERT、DELETE等),而这些信息在回滚段中是存在的,在Oracle 10g中,Oracle进一步加强了闪回查询的特性,提供了以下两种闪回查询:·
2013-08-30 10:05:26
933
原创 小结
如果有从数据库读流(大字段)的时候,每个字段读取要按顺序。否则报错误:流已关闭var url = "../zj/ssjgNewProjectDetail.jsp?qxCode="+qxCode+"&proNum="+encodeURI(encodeURI(proNum));String proNum = request.getParameter("proNum");proNum = U
2013-08-26 11:31:29
534
原创 java实现word套打(关于Freemarker生成word的使用(java生成word))
import java.io.BufferedWriter;import java.io.File;import java.io.FileOutputStream;import java.io.IOException;import java.io.OutputStreamWriter;import java.io.Writer;import java.util.ArrayL
2013-05-14 15:45:41
4611
原创 有指定的值就取指定的值,若没有就取最小值
select g.mnr from g_nr g where g.info_id = '1ecde282-384f-4bb3-8b9c-c78906965c2a' and g.nrtype = (select DISTINCT (case when (select nrtype from g_nr where info_id = g.info_id and nrtype = 3 and r
2013-04-02 17:11:50
515
原创 spring定时器
import org.quartz.Job;import org.quartz.JobExecutionContext;import org.quartz.JobExecutionException;public class Test implements Job{ public void execute(JobExecutionContext arg0) throws JobE
2013-03-28 11:01:47
437
kindeditor
2014-12-09
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人