易截截图软件、单文件、免安装、纯绿色、仅160KB

java存储过程的创建与调用

create or replace procedure updateProject is  
begin  
  update project p set p.total_intend_gather =   
  (select sum(ig.gather_sum) from intend_gather ig where ig.project_number=p.project_number);  
    
  update project p set p.total_actual_gather =   
  (select sum(ag.gahter_sum) from actual_gather ag where ag.project_number=p.project_number);  
    
  update project p set p.total_invoice=  
(select sum(invoice.invoice_sum) from invoice invoice  
 where invoice.intend_id in  
 (select ig.intend_id  from intend_gather ig where ig.project_number=p.project_number));  
   
end updateProject; 
Session session = this.getSession();  
Transaction tx =null;  
try {  
    tx = session.beginTransaction();  
    Connection con = session.connection();  
    String procedure = "{call updateproject() }";  
    CallableStatement cstmt = con.prepareCall(procedure);  
    cstmt.executeUpdate();  
    tx.commit();  
 
} catch (Exception e) {  
   tx.rollback();  


相关文档:

Java获取请求客户端的真实IP地址

通常通过request.getRemoteAddr()
取得客户端的IP地址,做鉴权和校验,逻辑没问题,那么肯定request.getRemoteAddr()出了问题,google下,发现有人遇到类似的问题。
最终定位为request.getRemoteAddr()这种方法在大部分情况下都是有效的。但是在通过了Apache,Squid等反向代理软件就不能获取到客户端的真实IP地址了。
......

java中的多态

面向对象编程有三个特征,即封装、继承和多态。
 
    封装隐藏了类的内部实现机制,从而可以在不影响使用者的前提下改变类的内部结构,同时保护了数据。
 
    继承是为了重用父类代码,同时为实现多态性作准备。那么什么是多态呢?
 
    方法的重写 ......

JAVA国际化


了解缺省Locale是由操作系统决定的,Locale是由语言和国家代码组成
国际化资源文件由baseName+locale组成,如:MessageBundle_en_US.properties(baseName是任意合法的文件名)
native2ascii命令的位置和用法
位置:JAVA_HOME/bin
使用native2ascii.exe o.properties MessagesBundle_zh_CN.properties 命令对整个文件 ......

java DOM 注意事项

1.  W3C把标签内的文本部分也定义成一个Node
2. 
Element对象代表的是XML文档中的标签元素
,继承于Node,亦是Node的最主要的子对象
3.  Attr实际上是包含在Element中的,它并不能被看作是Element的子对象,因而在DOM中Attr并不是DOM树的一部分,所以Node中的  getparentNode(),getpreviousSiblin ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号