`
a25765339
  • 浏览: 60761 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
//根据屏幕居中 window.open(URL,'','width='+width+',height='+height+',top='+(screen.height-height)/2+',left='+(screen.width-width)/2); //下面是根据页面居中 //window.open(URL,'','width='+width+',height='+height+',top='+(document.body.offsetHeight-height)/2+',left='+(document.body.offsetWidth-width)/2); //window.o ...
递归 SQL 在 DB2 中通过公共表表达式 (CTE,Common Table Expression) 来实现。递归 SQL 由递归 CTE 以及对递归 CTE 结果的查询组成。那什么是递归 CTE 呢?简言之,如果 CTE 中的 FULLSELECT 在 FROM 子句中引用到 CTE 本身,就是递归 CTE。递归 CTE 包含以下三个组成部分: •初始查询 初始查询是 CTE 中对基本表进行查询的部分。CTE 定义中的第一个 FULLSELECT 必须不包含对 CTE 自身的应用,即必须是初始查询。 •递归查询 递归查询就是通过对 CTE 自身的引用,从而启动递归逻辑的查询。递归查 ...
把一个毫秒转换成日期 private String timeToString(Long millisecond){ String str = ""; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Timestamp ts = new Timestamp(millisecond); str = sdf.format(ts); return str; } 计算X毫秒相当于几天 private String periodToS ...
用SimpleDateFormat 表示为: SimpleDateFormat utc = new SimpleDateFormat( "EEE MMM dd HH:mm:ss 'UTC+0800' yyyy", Locale.ENGLISH);
import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import org.apache.log4j.Logger; import org.apache.struts2.ServletActionContext; import org.springframework.beans.factory.BeanFactory; import org.springframework.context.ApplicationContext; import org.springfr ...
将struts.xml中的声明部分 <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd"> 替换为 struts2-core-2.xxx.jar中struts-default.xml的文件声明 <!DOCTYPE struts PUBLIC "-//Apache S ...
import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Set; import java.util.Map.Entry; public class GetKeyAndValue { public static void main(String[] args) { Map<String, String> map = new HashMap<String, String>(); map.put("key1& ...
public class TestMain { public static void main(String[] args) throws Exception { //泛型边界 Class<? extends TwoArgs> clazz = new TwoArgs().getClass(); Method [] methods= clazz.getDeclaredMethods(); String methodName = methods[0].getName(); //被调用方法的参数类型 Method method = clazz.g ...
public Object copyBean(Object source) throws Exception{ String getMethodName = ""; String setMethodName = ""; Method getMethod = null; Method setMethod = null; Class<? extends Object> sClass = source.getClass(); //用对象类型创建对象并获得对象的一个拷贝 Object destination ...
public Object deepClone(Object obj) throws Exception{ //将对象写入流 ByteArrayOutputStream bo = new ByteArrayOutputStream(); ObjectOutputStream oo = new ObjectOutputStream(bo); oo.writeObject(obj); //从流中读取对象 ByteArrayInputStream bi = new ByteArrayInputStream(bo.toByteArray()); ObjectIn ...
<?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" xsi:schemaLocation="http:/ ...
import java.sql.Timestamp; import java.text.SimpleDateFormat; import java.util.Date; import java.util.GregorianCalendar; public class DateTest { public static void main(String[] args) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); DateTest ...
1.计算某一月份的最大天数 public void test(int year, int i) { Calendar time = Calendar.getInstance(); time.clear();//在使用set方法之前,必须先clear一下,否则很多信息会继承自系统当前时间 time.set(Calendar.YEAR, year); // year 为 int time.set(Calendar.MONTH, i - 1);// 注意,Calendar对象默认一月为0 int day = time.getActualMaximum(Calendar ...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.text.DecimalFormat; import java.text.NumberFormat; import java.text.SimpleDateFormat; import java.util.Calendar; public class MyEclipseKeyGen { private static final String LL = "De ...
实现javax.servlet.ServletContextListener接口即可监听ServletContext创建过程中的两个关键事件:初始化和销毁 ServletContextListener.java源代码: //Compiled from ServletContextListener.java (version 1.2 : 46.0, no super bit) public abstract interface javax.servlet.ServletContextListener extends java.util.EventListener { // M ...
Global site tag (gtag.js) - Google Analytics