- 博客(26)
- 收藏
- 关注
原创 Math.abs(int) in Java
Math.abs(int):returns the absolute value of the parameter.If the parameter is equal to Integer.MIN_VALUE(-2147483648), it will return th
2011-08-09 23:23:11
1073
原创 Summary on 20081111: system method in sql server2005
In sql server 2005, there is no support for array.when you print something using print @dddvalue, when @dddvalue is null, there will be nothing printedcharindex(search, @src) will get the ind
2008-11-11 21:35:00
416
原创 Summary on 20080820: when hibernate session will be flushed
Hibernate session will be flushed in the following scenario:1. use session.flush()2. do search use session3. use transaction.commit()
2008-08-20 22:48:00
372
原创 Summay on 20080820: Hibernate operation method comparation
Hibernate provide kinds of operation methods to save/update/delete object. here we just give one simple conclusion of those method and their difference: save/update/saveOrUpdatethose three metho
2008-08-20 22:20:00
394
原创 Summary on 20080717: web page refresh
These days Im working on web page refresh, and find that there are lots of ways to refresh page:1. window.location.reload(true/false)2. window.location.href = window.location.href(url)3. window.locat
2008-07-17 22:34:00
455
原创 Summary on 20080716: close the current page through backend bean method
There is such process that: in home page, click some link/button to open one pop up child window, in the window, input/edit/add some content and click submit button to submit the change, if the cha
2008-07-16 20:56:00
410
原创 merge two column into one field in sql and hql
some times, we want to consider two columns in db as one field in service, for example, well save first name and last name seperately in db, but in UI, we want to display them together.In this case,
2008-07-13 23:11:00
600
原创 Summary on 20080710: union and projection search by QBC
1. union and projection search by QBC:in hibernate, QBC can do projection search by use the Projections class.The implementation can be as followed:Class Student{ Integer stuId;
2008-07-10 23:42:00
418
原创 Summary on 20080707: Hibernate operation on many-to-one relation
Hibernate many-to-one relation mapping:public class Student{ ..... private CoreClass class; public CoreClass getter.... public void setter}public cl
2008-07-07 23:57:00
438
原创 Summary on 20080706: setting for many-to-many mapping in hibernate
For n-n relationship in database, hibernate supplies the many-to-many mapping type. lets take the class and teacher relation as the example; one class can have different teachers, and also, one teach
2008-07-06 23:05:00
393
原创 Hibernate cascade order for one-to-many mapping
1. for one-to-many: teacher 1: n students the order of save: save teacher, save students, update students with teacher idthe order of delete: update students, set teacher = null, delete students,
2008-07-03 23:39:00
387
原创 Summary on 20080703: Attention for hibernate operation
1. Check null for result returned by get, because if the object specified by identifier id is not exist in db, null will be returned2. Check the list returned by hibernate, 2.1 check whether the l
2008-07-03 23:33:00
324
原创 Summary on 20080701: insert value for identity column in sql
In MSSQLServer, by default, user can‘t insert/assign/update value for identity column; SQLServer will do this for user automatically, so there is one problem caused that: what will do if wants to ass
2008-07-02 21:39:00
434
原创 Summary on 20080626: hibernate configuration and hbm2ddl tool
xml file is actualy like the following format: PUBLIC "-//hibernate/hibernate mapping dtd 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">in the hibernate configu
2008-06-27 00:06:00
359
原创 Summary on 20080626: some difference between JDBC transaction and JTA
transaction in JDBC is based on connection, one transaction can only has one connection, which is actually one session;JTA is based on transaction manager, one transaction in JTA can go across more th
2008-06-26 23:52:00
466
原创 Summary on 20080623: dispatch in servlet
In servlet, there is class named RequestDispatcher, this dispatcher will send/include the request to another web resource, like JSP or Servlet. In jsp, there is expression like: or , however, those e
2008-06-23 20:45:00
436
原创 Check for the content of input in UI
I think for any UI input field, we should do the following check:1. whether empty string is allowed2. whether duplicate value is allowed3. whether special character is allowed, like: @, #, $, &
2008-06-22 22:35:00
452
原创 how to config when use hibernate+sqlserver2005
1. there is sql server 2005 express edition which is free, user can download from: http://msdn.microsoft.com/zh-cn/express/bb410792.aspx 2. download jdbc driver from micorsoft, choose the proper dri
2008-06-22 17:43:00
591
原创 Summary on 20080617: using forward or redirection in jsp and servlet
In Jsp and Servlet, when traverse between Jsp page and Servlet, there are two ways:1. using jsp:forward2. using response.sendRedirect(url)here is the summary of the each method:jsp:forward
2008-06-17 23:53:00
359
原创 Summary on 20080616: Basic usage of Enum in Java1.5
The type Enum is imported by Java1.5, here are some of the notice about using Enum in Java1. Enum is actually one interface2. Consider Enum as one simple class with several pre-defined instance, s
2008-06-16 22:03:00
473
原创 Summary on 20080613: the meaningless variable in JavaScript
In JavaScript, there are some meaningless variable/value, which means, in logic expression, those meaningless variables will return false for ever.Those meaningless variables include: NULL, 0, false
2008-06-15 09:59:00
383
原创 Summary on 2008-06-12: How to check one session is valid
1. before invalidate the session, its necessary to check whether the session is still valid,HttpServletRequest supply one method called: isRequestedSessionIdValid()this method will check whether
2008-06-12 22:59:00
860
原创 Java: PrintWriter.write 向文本文件中写入换行。
Today I use java to parse a file and get some special content and write the content to another file.I met a strange problem that when I use pw.writer("/n"); to write a newline, it failed. I also trie
2007-10-24 20:07:00
12952
3
原创 上海火车票订票电话
上海站:800-820-7890 手续费10元/张 铁路上海站售票电话:800-820-7890 95105105 卧铺手续费:15-20元/张 ----------------------------------------------------------------------- 53560208 53500108 好象不
2007-02-09 12:57:00
3518
1
原创 How to be a professional Java developer
刚看到一个java高手写的一篇文章,关于java程序员的发展规划的,在此贴出链接,希望大家共勉http://blog.youkuaiyun.com/gup21cn/archive/2006/06/22/821709.aspx 我的处女blog,哈哈
2007-01-21 15:12:00
585
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人