dmwdmc
dmwdmc · 共 157 篇文章
select 结构执行顺序
** (8)SELECT(9)DISTINCT(11) ( 1 ) FROM ( 3 ) JOIN ( 2 ) ON ( 4 ) WHERE ( 5 ) GROUP BY ( 6 ) WITH ( 7 ) HAVING ( 10 ) ORDER BY ** 这里同时注意数据查询顺序在同等条件下:1.先子查询后父查询;2.从右到左
2013-06-02 19:13 · 数据库 持久层 · 评论(0)
查询语句(SELECT)的优化
首先要注意建立索引。 create index abindex on tableAB (columnA, columnB); 对于索引同时要注意: 主键,unique键 会自动产生索引。 数据量小不需要索引,避免消耗数据库内存。 在有索引的机制上 (1)、合理使用索引:where子句中变量顺序应与索引字键顺序相同。 如:create index test_idx on test(hm, rq, xx) 索引字键顺序:首先是号码hm,其次是日期rq,最后是标志xx,所以where子句变量顺序应是where hm<=“P1234”and rq=“06/06/1999”and xx=“DDD”,不…
2013-06-02 19:11 · 数据库 持久层 · 评论(0)
关于计算1 1 2 3 5 8 13 的算法
这个题目的算法,应该自己能想出来的,这题比较简单。 除非是个傻子,正常人都应该10分钟内想出来。 public static void main(String[] args) { int n1=1; int n2=1; System.out.print("1,1,"); for(int i=3;i<=30;i++){ int temp=n1; n1=n1+n2; n2=temp; System.out.print(n1+","); } } 得出的结果是: 1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10…
2013-06-01 13:04 · 算法 算数 智力题 · 评论(0)
父子类的加载顺序和父类参数
public class Father { static { System.out.println("static Father"); } Father(){ System.out.println("construction Father"); } } public class Son extends Father{ static { System.out.println("static Son"); } Son(){ System.out.println("construction Son"); } } public class Test { public static void main…
2013-06-01 09:53 · core JAVA jvm · 评论(0)
+操作符 不能被byte,short 类型接收
这样可以 public static void main(String[] args) { byte i=1,j=0; double k=i+j; System.out.println(i+j); } 以下会出错 public static void main(String[] args) { byte i=1,j=0; byte k=i+j;//这里会包编译出错。 int 不能转化给byte. +默认是 int型,但是也可以给double,float,long使用 System.out.println(i+j); } short也同理byte.
2013-06-01 09:37 · core JAVA jvm · 评论(0)
标准jquery ajax ,编码问题
编码问题,主要还是靠Filter来解决。 不过我们可以尝试在jquery ajax里加 contentType: "application/x-www-form-urlencoded; charset=utf-8", 加完后 $("#Load").click(function(){ var postData ='name=Tian Cai'; $.ajax({ url:"https://localhost:9444/HKGCB/content.jsp", type:"POST", data:postData, dataType:"json", contentType: "applicatio…
2013-05-31 16:34 · javascript ajax jquery · 评论(0)
Bean 的加载时机和延迟加载
在ssh框架中,我们的beans.xml(或者spring.xml)里配置了bean的构造条件。 这里的bean默认都是在服务器启动时就直接加载到内存里的。 即我们类里的相关这些bean的set方法在服务器启动时候就立即调用,加载构造bean对象。 <bean name="/index" class="action.IndexAction"> <property name="roomBlo"> <ref bean="roomBloProxy" /> </property> </bean> 但是如果我们加了 lazy-init="true" 后, 服务器启动时就不加载了,直到我们访问/inde…
2013-05-31 16:34 · 框架相关文章 · 评论(0)
ssh 框架中spring的事务控制
ssh框架中,通常我们的action会注入一个blo类,及服务层类,这个类里可以处理业务逻辑,执行多个dao的操作。 这个类是受spring事务控制的。例如以下代码,当我们请求addRoom.do的时候,就把页面输入的Room信息发到后台,从而达到插入数据库的操作。 但是这个操作如果在roomBlo里出现异常,即使插入数据库操作已完成,就会把事务回滚,从而自动取消刚刚完成数据库操作。 注意这里配置的事务类型是PROPAGATION_REQUIRED beans.xml <bean name="/addRoom" lazy-init="true" class="action.AddRoomAc…
2013-05-31 16:34 · 框架相关文章 · 评论(0)
标准jquery ajax ,接收json数据
content.jsp. <% String mname=(String)request.getParameter("name"); out.println("{\"comments\":[{\"name\":\""+mname+"\",\"id\":1,\"nickname\":\"king\"},{\"name\":\"ben\",\"id\":2,\"nickname\":\"bow\"}]}"); %> 这里转义号和mname之间格式要注意, mname如果是字符串,那一定两边要加双引号。否则json不能解析。 test.jsp <html> <head> <script type=…
2013-05-30 18:08 · javascript ajax jquery · 评论(0)
标准jquery ajax ,发送json数据
这里有两种做法。 做法1: 前端 test.jsp <html> <head> <script type="text/javascript" language="JavaScript" src="/JFP/js/jquery/jquery-1.5.1.js"></script> </head> <body> <table> <tr> <td id="Load">Button</td> <td><input value="" size="100" /></td> </tr> </table> <script> $("#Load").click(function(){ var postData …
2013-05-30 17:36 · javascript ajax jquery · 评论(0)
标准jquery ajax ,普通数据类型
content.jsp. My name is : <%=request.getParameter("name")%> test.jsp <html> <head> <script type="text/javascript" language="JavaScript" src="/JFP/js/jquery/jquery-1.5.1.js"></script> </head> <body> <table> <tr> <td id="Load">Button</td> <td><input value="" size="100" /></td> </tr> </table> <script>…
2013-05-30 16:16 · javascript ajax jquery · 评论(0)
jquery 最简单的ajax 例子
content.html......... I am from another HTML... test.html ........... <html> <head> <script type="text/javascript" src=".../jquery-1.js"></script> </head> <body> <table> <tr> <td id="Load">Button</td> <td><input value="" size="100" /></td> </tr> </table> <script> $("#Load").click(function(){ $("#Lo…
2013-05-30 15:45 · javascript ajax jquery · 评论(0)
jquery 事件需后加载,否则失效
<html> <head> <script type="text/javascript" src=".../jquery.js"> </head> <body> <table> <tr> <td id="Load">Button</td> </tr> </table> <script> //以下事件加载必须在 html加载完td Load 单元后再加载,否则会失效。 [color=blue]$("#Load").click(function(){ alert("hahaha"); });[/color] </script> </body> </html> 比如以下这么写,事件就无法加载。
2013-05-30 15:37 · javascript ajax jquery · 评论(0)
axis2教程
http://wenku.baidu.com/view/5eb1aff79e314332396893c7.html 生成客户端java C:\axis2\bin>wsdl2java.bat -uri http://localhost:8080/axis2/services/BenTest?wsdl -o C:\输出目录 -p 输出包名 timeout private static void setTimeOuts(Stub paramStub) { if (paramStub == null) return; Integer localInteger1 = getSoTimeout(); I…
2013-05-29 01:48 · 消息服务 · 评论(0)
一家银行网站涉及的主要设计模式
1.组合模式 银行金融系统框架这边,我们最常见的就是用配置文件里面的rule来控制统一的代码来实现每个不同国家不同条件下的多样性。 这里的设计思想就是 结构模式下的 组合模式。 组合模式分为 leaf, component, composite, client. leaf 就是各个不同的被rule控制的字段,逻辑。 component是个抽象存在,和金融系统框架这里不十分贴切,可以忽视。 composite就是ResultSet. client就是我们最终显示的jsp,html. 2.代理模式。 金融系统框架核心框架就就是以代理模式为基准的。 代理类: 当访问一个请求是,我们会把请求转给一个…
2013-05-29 00:24 · 设计模式 · 评论(0)