ITeye博客

2009 年文章归档

共 94 篇文章

T is part of return and no parameter is needed in method definition

Method definition private <T extends ModelData> ListStore<T> createCommaSeparatedWildcardListStore() { ListStore<T> store = new CustomFilterListStore<T>(); store.addFilter( new CommaSeparatedWildcardStoreFilter<T>()); return store; } Method usage this .companiesListStore = createCommaSeparatedWildc…

2009-12-09 15:25 · Generics

SQL Summary

show primary key info sp_pkeys EMPLOYEE set a explicit pk name during creating table CREATE TABLE EMPLOYEE ( ID int Not Null CONSTRAINT pk_EMPLOYEE_ID PRIMARY KEY, FirstName nvarchar(20), LastName nvarchar(20) ) or CREATE TABLE EMPLOYEE ( ID int Not Null, FirstName nvarchar(20), LastName nvarchar(2…

2009-12-09 11:41 · Sql Server · SQL · F#

数据库分页

sqlserver2000的分页就是利用top、order by、asc、desc这几个关健字来控制分页查询。 mysql是通过limit等关健字。 而oracle则是利用rownum这个虚列来进行分页。 http://www.vifir.com/bbs/html/20080527/426030.html

2009-12-07 11:56 · Sql Server · HTML · BBS · MySQL · Oracle

eclipse breakpoint doesn't work

simply delete .metadata folder of workspace, reimport all projects, rebuild,rerun.

2009-12-04 11:01 · eclipse · Eclipse

equals(), hashCode() and toString()

@Override public boolean equals(Object object) { return EqualsBuilder. reflectionEquals ( this , object); } @Override public int hashCode() { return HashCodeBuilder. reflectionHashCode ( this ); } @Override public String toString() { return ToStringBuilder. reflectionToString ( this );

2009-11-18 21:49 · Java Basic

GXT tricky issues

I’ve learned 3 tricky issue solutions today, of GXT, credit to genius Kevin. “did you forget to inherit a required module” error. This error is because, when GWT compiling Java source code into javascript, it needs the java code source code. If you in a GWT application, use a class which doesn’t in…

2009-11-17 01:03 · GXT · GWT · XML · JavaScript

SQL Server 日期格式转换

SQL Server中文版的默认的 日期 字段datetime 格式 是yyyy-mm-dd Thh:mm:ss.mmm 例如: select getdate() 2004-09-12 11:06:08.177 整理了一下SQL Server里面可能经常会用到的 日期格式 转换方法: 举例如下: select CONVERT(varchar, getdate(), 120 ) 2004-09-12 11:06:08 select replace(replace(replace(CONVERT(varchar, getdate(), 120 ),'-',''),' ',''),':','') …

2009-11-10 19:34 · Sql Server · SQL Server · SQL

GXT CSS Usage

It’s pretty simple. Some key points to note as follow: 1) Quite often, you find your change to the .css file doesn’t take effect. The key question here, are you changing the right .css file? I find several .css files in my project. One of them is in war/css/aa.css, another is in ./css/aa.css. 2) Ad…

2009-11-02 16:40 · GXT · CSS · GWT

SQL Server common issues

ISSUE 1: Incorrect syntax near 'GO'. replace GO with ; 1) GO is a keyword for Query Analyzer, not belongs to T-SQL. So, if you don't use Query Analyzer, GO is not recoganized. 2) GO instructs Query Analyzer to interpret and run the preceding T-SQL statments. ISSUE 2: Incorrect syntax near the keywo…

2009-10-21 16:04 · Sql Server · SQL Server · Go · SQL

不要通过CREATE TABLE语句来创建default constraint

The reason why you should not use CREATE TABLE to create the default constraint is, system will generate a random constraint name for you. And when you drop it, your sql will be only workable in either dev/uat/prod db, but not all 3 dbs. http://msdn.microsoft.com/en-us/library/aa175912(SQL.80).aspx…

2009-10-21 13:15 · Sql Server · SQL Server · Sybase · Go · SQL · Microsoft

Incorrect syntax near the keyword 'DEFAULT'

I met this issue on Oct 21st, 2009. The Sql Server conplains db.update: [sql] Failed to execute: ALTER TABLE Green ALTER COLUMN Enabled nChar(1) not null DEFAULT 'Y' BUILD FAILED com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'DEFAULT'. The reason is because ther…

2009-10-21 11:03 · Sql Server · SQL Server · SQL · JDBC · Microsoft

how to set up env variable in linux

Summary: Step 1) Know your current shell. echo $SHELL Step 2) Set env if csh or tcsh vi ~/.schrc setenv PATH “/bin:/usr/bin:/usr/sbin:/usr/ucb/bin” if bash vi ~/.bashrc export PATH=“/bin:/usr/bin:/usr/sbin:/usr/ucb/bin” ====Original text======================== 环境变量是啥呢? 环境变量为你的shell储存各种默认值,使你的生活更加轻…

2009-09-03 10:46 · unix and linux · 网络应用 · Java · Bash · UP · Linux

log4j config sample -- display log both to log file and console

<?xml version= "1.0" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j= 'http://jakarta.apache.org/log4j/' > <!-- ==application log file====================================== --> <appender name= "appLogFile" class= "org.apache.log4j.RollingFileAppender" > <param …

2009-09-02 16:26 · log4j · Apache · XML · log4j

java start up arg samples

Unix env setup jflags="-ms1536M -mx1536M -Xnoclassgc" gcVerbose="-verbose:gc" jconsole="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8003 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false" remoteDebug="-Xdebug -Xnoagent -Djava.compiler=…

2009-08-24 16:29 · Java Basic · Java · Socket · Unix · UP · SUN

How to judge whether this is a 32 bit jvm or 64 bit jvm?

[Solution 1] java –version command after jdk1.6 can give you 32 bit or 64 bit info. Before jdk1.5, doesn’t contain this info. [Solution 2] In linux env, run this command to check . file /usr/java/jre1.5.0_09/bin/java [Solution 3] 32 bit jvm has a limitation of memory usage of less than 2G or 4G. Ca…

2009-08-24 13:33 · Java Basic · Java · UP · JVM · Linux

check linux memory usage

/proc/meminfo contain all your memory usage information:- type: cat /proc/meminfo and you will get:- vmstat display memory usage in summary mode:- type: vmstat and you will get Click on the image to see bigger image free command:- type: free or free -m Click on the image to see bigger image free -m…

2009-08-23 15:00 · unix and linux · Linux

jconsole easy usage

client side java_home/bin/jconsole.exe service:jmx:rmi:///jndi/rmi://192.168.***.***:8003/jmxrmi Server side add this parameter -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port= 8003 -D com.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false Perfor…

2009-08-22 12:31 · Java Basic · Java · .net · performance · SUN

eclipse remote debug

The most important thing is: The jdk of server side and client side must be exactly the same. then in start command: remoteDebug="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1861"

2009-08-22 10:41 · Java Basic · Socket · Eclipse · JDK

javax.jms.InvalidDestinationException

com.citigroup.get.quantum.messaging.MessagingException: javax.jms.InvalidDestinationException: Not allowed to create destination at com.citigroup.get.quantum.messaging.transport.JMSTransportSender.send(JMSTransportSender.java:220) at com.citigroup.get.quantum.messaging.internal.Sender.runInternal(S…

2009-08-21 10:06 · JMS · Java · JMS · Access

variable definition

A sample shell script #!/bin/sh viperooe_home=`dirname $0` source $viperooe_home/env-viperooe.sh instancename=$1 cd $viperooe_home/persistence/$1 currentDate=`date '+%Y%m%d'` echo $currentDate currentTime=`date '+%H%M%S'` echo $currentTime logName=orderStoreRatio-$currentDate-$currentTime.log echo …

2009-08-18 09:40 · unix and linux · C · C++ · C#