随笔分类 -  Java

Java relevant
摘要:JPDA and Java Remote Debugging in Tomcat 阅读全文
posted @ 2013-08-15 21:06 FangwenYu 阅读(438) 评论(0) 推荐(0)
摘要:The following notes are based on the article "Mastering Spring MVC", which is, though, a little bit old, but very helpful for beginners, like me.The MVC Framework landscapeBesides Spring MVC, there are also some other frameworks, like Structs, Wicket, JavaSerer Faces(JSF), Seam, etc.A brei 阅读全文
posted @ 2012-10-11 20:12 FangwenYu 阅读(345) 评论(0) 推荐(0)
摘要:Excerpted from <<Pro Spring 3.0>> Chapter 17Introducing MVCFigure 17-1 illustrates a commonly used web application pattern, which can be treated as an enhancement to the traditional MVC pattern. A normal view request is handled as follows: 1. Request: A request is submitted to the server 阅读全文
posted @ 2012-10-11 20:11 FangwenYu 阅读(2683) 评论(0) 推荐(0)
摘要:A simple example to create java stored procedure in oracle 阅读全文
posted @ 2012-09-03 20:57 FangwenYu 阅读(884) 评论(0) 推荐(0)
摘要:Use Java Compiler API for arithmetic expression calculation 阅读全文
posted @ 2011-10-13 19:52 FangwenYu 阅读(605) 评论(0) 推荐(1)
摘要:Compile the Java code dynamically using JDK6 阅读全文
posted @ 2011-10-12 21:03 FangwenYu 阅读(8762) 评论(1) 推荐(0)
摘要:关于在SQL语句中是用Bind Variables的重要性就不用多说了,最近在看代码的时候发现有一条比较耗时的SQL语句居然是在Java代码中动态拼接而成的。这条SQL语句之前也进行过一些简单的重写优化工作,在with语句中特别用到hint 了/*+materialize*/。之前认为这个hint在WITH语句中没有必要使用,Oracle应该会自动创建一个临时表用于with语句结果的存储,结果居然发现加不加这个hint差别还是蛮大的,最后就加上了这个hint.OK,回到正题上来。这个SQL需要接收的参数是一个动态的逗号分隔的字符串,放在in list中用的。很显然,如果用PL/SQL来写这个语 阅读全文
posted @ 2011-08-05 18:29 FangwenYu 阅读(311) 评论(0) 推荐(0)
摘要:About AnnotationJava 5引入了Annotation, 这极大减轻了开发的负担,不用写很多的代码,只需要在代码中加入一些"tag"就可以了,这个很符合声明式编程(declarative programming)的思想。当然有个问题还是要问的,虽然作为使用annotation的开发者来说,不用考虑Annotation最后究竟会被怎样执行,只要在需要使用Annotation的地方tag一下就可以,但是很显然这个只是把问题处理地点转移了而已,终归是需要有人来处理的,不然,这个Annotation就没有任何意义了。可以想见,很多JDK提供的annotation, 阅读全文
posted @ 2011-08-01 23:06 FangwenYu 阅读(478) 评论(0) 推荐(0)
摘要:在Hibernate中, 可以用类似Oracle中的sequence来生成对象的标示。如下例所示,通过是用SequenceGenerator这个Annotation, 将Oracle的sequence -- SEQ_LIMITS_CHANGES ”绑定“ (通过GeneratedValue这个annotation)到了Class LimitsChangeDO 中ID这个field上。public class LimitsChangeDO { @GeneratedValue(generator = "limits_review_limit_sequence") @Sequen 阅读全文
posted @ 2011-08-01 15:46 FangwenYu 阅读(657) 评论(0) 推荐(0)
摘要:Spring框架中很重要的一部分是关于IoC的,Spring提供了ApplicaitonContext这样一个接口 (bean factory),通过它来创建bean。除了这个接口,Spring提供了一些具体的context实现类,包括ClassPathXmlApplicationContext,FileSystemXmlApplicationContext,XmlWebApplicationContext 和XmlPortletApplicationContext。通过创建一个简单的例子来看一下Spring IoC是怎么使用的。首先在Eclipse里面创建一个Java Project, 目录 阅读全文
posted @ 2011-07-28 16:24 FangwenYu 阅读(425) 评论(0) 推荐(0)