ITeye博客

tanglei198577的博客

tanglei198577 · 共 63 篇文章

清理mongodb最老的数据

public class MongoDBDataClean { public static void main(String[] args) throws Exception { TimerTask task = new TimerTask(){ @Override public void run() { clearMongoData(); } private void clearMongoData() { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); System.out.println("Start…

2017-01-18 14:20 · java · 评论(0)

db2

Class.forName("com.ibm.db2.DB2Driver"); String url = "jdbc:db2://localhost:port/databaseName"; DriverManager.getConnection(url,username,password); SimpleDateFormat dayFormatter = new SimpleDateFormat("yyyy-MM-dd-"); Calendar lastDay = new GregorianCalendar(); lastDay.add(Calendar.DATE-1); String st…

2012-02-20 17:37 · java · 评论(0)

网上银行one

关于网银的一些认识,一般有个人网银和企业网银,功能很类似,企业网银更复杂些。 首先网银登陆的过程中一般会做些什么事情呢 首先会有用户信息密码验证,一次性密码(OTP)验证,然后再 1.获得用户的一些基本信息,信用等级程度以及可以享用的优惠之类的。 2.获得用户所有的账号信息:首先这个账户是下列三种账户的一种 同名账户(Same Name):一个用户名以下的所有账户。 第三方账户(Third party):一个银行下的其他用户的账户。 他行账户(Other bank):其他银行的账户。 然后是账户种类:分为基本账号(primary account),往来户口(current account),…

2011-10-24 23:08 · java · 评论(0)

send email by java api

First ,create a properies file for config file, EmailSMTP=mail.*.com FromAddress=email@*.com EmailUser=email EmailPassWord=email ToAddress=tom@*.com;ray@*.com FileName=H://*.txt;H://*.txt ShowFileName=*.txt then the java code should be: package com.test; import java.io.BufferedInputStream; import j…

2010-12-21 17:46 · java · 评论(0)

ireport using javabean as the datasource

转自: http://hi.baidu.com/nieweiguo/blog/item/b92e369bf0c882b6c8eaf476.html 步骤如下: 首先在ireprot里做好所需要报表,保存 好 ireport里面的字段就是你要传入到jasper里的list所封装的model的字段,一一对应即可, 在ireport里面要设置报表字段(如果要传参数到报表里,则要在ireport设置报表参数) ,做好报表后,就在后台ACTION(自己可以在JSP,SERVLET 封装等...)封装数据了,我做了个测试片段如下: List list=new ArrayList(); for(int i…

2010-10-28 14:11 · java · 评论(1)

Export the excel/txt file of report list by java

First of all, we should click a button or some pic to trigger the action of exporting,here I used a button: <input type="button" value="Export" onclick="export()" class="buttoncss"/> Then the export function should like: window.location.href="*.do?method=exportList" whick the method used for achiev…

2010-09-21 16:16 · java · 评论(2)

Use the batch file to execute the sql

REM ********** REM Modify the values below to match your configuration REM ********** set v_mysqlHost=192.168.*.130 set v_mysqlPort=3306 set v_mysqlUser=admin set v_mysqlPassword=111111 set v_mysqlDatabase= testBase REM if the mysql sever deployed on linux system set v_storePathLinux=/tmp set v_sto…

2010-06-23 11:18 · DataBase · 评论(0)

something need to learn

关于JAVA,方向在哪? 1、主流框架要掌握如(ssh),没事可以了解下jsf,shale,seam,richface,jpa 框架。 2、对于各种缓存的分析利弊,能灵活运用 如memcache,Oscache, 内存数据库timesken,嵌入数据库b-db等。。。。。 3、向网络、通信方面发展,比如说写个类似于mina的框架,写写类似于游戏服务端的东西,自己可以写协议,支持高并发。 4、掌握几种主流数据库,oracle,sql ,mysql等,可以书写复杂的存储过程,mysql之类的分布、集群掌握一下。 5、会用轻量级别的SOA框架,如serviceMix,Mule等。。。JMS消息队列…

2010-05-04 17:56 · Random thinking · 评论(0)

Problems when learning ruby

1.The exception is: Status: 500 Internal Server Error no such file to load -- sqlite3 solution: need to download sqlite3.rar ,then uncompressed at the ../ruby/bin folder,then gem install sqlite3-ruby-1.2.3-mswin32.gem 2.undefined method `render_text' for # RAILS_ROOT solution: change render_text "h…

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

pass values from jsp to applet

define a object in jsp: <object classid="clsiD:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA" width=1000 height=750 codebase="http://java.sun.com/update/1.5.0/jinstall-1_5_0-Windows-i586.cab#Version=1,5,0,0"> <param name="code" value="com.test.class"> <param name="codebase" value="."> <param name="archive" …

2010-04-16 16:56 · Swing · 评论(0)

debug swing

When u want to test the swing , java console can show some info by system.out.print. Go to start - > Control panel, then select Java control panel and open it. Select Advanced option,then u can see Java console, select "Show console" then press "OK" button by the way,a useful note for listening the…

2010-04-15 16:22 · Swing · 评论(0)

swing listeners

Listeners that needed when we want to deal with some event, addWindowListener(new WindowAdapter()) public abstract class WindowAdapter implements WindowListener, WindowStateListener, WindowFocusListener { /** * Invoked when a window has been opened. */ public void windowOpened(WindowEvent e) {} /**…

2010-03-26 14:04 · Swing · 评论(0)

A example of treepanel of Ext

var root = new Ext.tree.TreeNode({ id:"root", text:"Sample" }); var ITDep = new Ext.tree.TreeNode({id:"c1",text:"IT Dep",href:"http://www.sina.com",hrefTarget:"_blank",leaf:false}); var HRDep = new Ext.tree.TreeNode({id:"c2",text:"HR Dep",leaf:false}); root.appendChild(ITDep); root.appendChild(HRDe…

2010-03-19 14:40 · JavaScript · 评论(0)

Tree set for sorting

code: Set<Pattern> sortedPatterns = new TreeSet<Pattern>(); for(Pattern pattern : project.getPatterns()){ sortedPatterns.add(pattern); } project.setPatterns(sortedPatterns); Then the Pattern need to implements Comparable interface then finished your method compareTo with your requirement is ok here…

2010-03-18 09:09 · 评论(0)

unique foreign key mapping of hibernate example

First the ddl language of the table used with foreign key as : CREATE TABLE `t_operation_log` ( `id` BIGINT(24) NOT NULL AUTO_INCREMENT, `resourceId` BIGINT(24) NOT NULL, `systemlogId` BIGINT(24) NOT NULL, `operationTime` DATE DEFAULT NULL, PRIMARY KEY (`id`), KEY `resourceId` (`resourceId`), KEY `…

2010-03-09 11:29 · SSH · 评论(0)