摘要: HQL: from Student s where s.age>:agehibernateTemplate.getSessionFactory().openSession().createQuery(hql).setInt("age",15); from student s where s.id in (:ids) hibernateTemplate.getSessionFactory().openSession().createQuery(hql).setParameterList("ids",new integer[]{100,102}); S 阅读全文
posted @ 2013-03-18 11:06 panlovestan 阅读(302) 评论(0) 推荐(0) 编辑
摘要: <input id="btnPrint" type="button" value="打印" onclick="javascript:window.print();" /> <input id="btnPrint" type="button" value="打印预览" onclick=preview(1) /> <style type="text/css" media=print> .noprint{d 阅读全文
posted @ 2013-03-12 17:07 panlovestan 阅读(186) 评论(0) 推荐(0) 编辑
摘要: --建立自增序列create sequence seqidNOMAXvaluestart with 1increment by 1nocacheorder;--建立触发器create or replace trigger tri_test_id before insert on mytable --mytable为要插入自增序列的表 for each rowdeclare nextid number;begin IF :new.Id IS NULL or :new.Id=0 THEN --id是要插入自增序列的列名 select seqid.nextval int... 阅读全文
posted @ 2013-03-12 16:19 panlovestan 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 每一个java屌丝程序员都应该了解,jxl可以向excel单元格中添加数据,但是可以生成非常常用的折线表吗(通俗一点就是屌丝小学时候学的有x轴y轴,还有各种坐标点连接成的线)?查看jxl帮助文档后可能又让众屌丝失望了,jxl无法生成动态折线图,但是没关系,此路不通开彼路。下面就像大家介绍一下如何生成excel折现表——模板方法。所谓模板方法是首先在office工具中生成折线图,然后根据表格中的数据生成折线图。 生成excel折线表分为两种情况,第一种:格式固定,数据变动。第二种:格式变动,数据亦变动。 废话不多说,先介绍第一种。想了解此方法之前须对microsoft excel 如何使用表.. 阅读全文
posted @ 2013-03-12 14:39 panlovestan 阅读(2002) 评论(2) 推荐(5) 编辑
摘要: Date.parse("3-7-2013")Date.parse("03-07-2013")Date.parse("mm-dd-yyyy"); 阅读全文
posted @ 2013-03-07 16:33 panlovestan 阅读(489) 评论(0) 推荐(0) 编辑
摘要: //计算传入的时间差,返回天数function calc(str1,str2){ var date1= new Date(str1.substr(0,4),parseInt(str1.substr(5,2))-1,str1.substr(8,2)); var date2= new Date(str2.substr(0,4),parseInt(str2.substr(5,2))-1,str2.substr(8,2)); return parseInt((date1.getTime()-date2... 阅读全文
posted @ 2013-03-07 15:49 panlovestan 阅读(154) 评论(0) 推荐(0) 编辑
摘要: //去左空格;functionltrim(s){returns.replace(/(^\s*)/g,"");}//去右空格;functionrtrim(s){returns.replace(/(\s*$)/g,"");}//去左右空格;functiontrim(s){//returns.replace(/(^\s*)|(\s*$)/g,"");returnrtrim(ltrim(s));} 阅读全文
posted @ 2013-03-07 14:12 panlovestan 阅读(180) 评论(0) 推荐(0) 编辑
摘要: js Date-摘自互联网Date 对象用于处理日期和时间。创建 Date 对象的语法:var myDate=new Date()Date 对象会自动把当前日期和时间保存为其初始值。参数形式有以下5种: new Date("month dd,yyyy hh:mm:ss"); newDate("month dd,yyyy"); newDate(yyyy,mth,dd,hh,mm,ss); new Date(yyyy,mth,dd); new Date(ms);注意最后一种形式,参数表示的是需要创建的时间和GMT时间1970年1月1日之间相差的毫秒数。各种函 阅读全文
posted @ 2013-03-07 11:21 panlovestan 阅读(466) 评论(0) 推荐(0) 编辑
摘要: 先说一下java工程下目录的获取的几种方法,有用的看客可以看一下:1.new File("relative path").getAbsolutePath();2.System.getProperties.getProperty("user.dir");然后进入主题javaweb中servlet中:request.getSession().getServletContext().getRealPath();获取跟目录(例:C:\apache-tomcat-6.0.35\webapps\webTest)Struts的aciontion中ServletActi 阅读全文
posted @ 2013-03-06 17:05 panlovestan 阅读(654) 评论(0) 推荐(0) 编辑
摘要: 用数据说话:同样的环境下测试4次//省时分页select * from(select a.*,rownum rn from (select * from cfma_dms_report) a where rownum<40) where rn>20 耗时:22.4 27.3 22.0 23.2//耗时分select * from(select a.*,rownum rn from (select * from cfma_dms_report) a ) where rn between 20 and 40 耗时: 36.09 27.25 28.3 32.1 阅读全文
posted @ 2013-03-06 16:21 panlovestan 阅读(111) 评论(0) 推荐(0) 编辑