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();
}
相关文档:
通常,多线程之间需要协调工作。例如,浏览器的一个显示图片的线程displayThread想要执行显示图片的任务,必须等待下载线程downloadThread将该图片下载完毕。如果图片还没有下载完,displayThread可以暂停,当downloadThread完成了任务后,再通知displayThread“图片准备完毕,可以显示了”,这时,displayThread ......
额外JAR包:
org.springframework.expression-3.0.1.RELEASE.jar
org.springframework.asm-3.0.1.RELEASE.jar
org.springframework.beans-3.0.1.RELEASE.jar
p:statementCacheSize="100"
<bean id="masterDataSource" class="com.jolbox.bonecp.BoneCPDataSource" destroy-method="close"
p:driverClass="com.m ......
面向对象编程有三个特征,即封装、继承和多态。
封装隐藏了类的内部实现机制,从而可以在不影响使用者的前提下改变类的内部结构,同时保护了数据。
继承是为了重用父类代码,同时为实现多态性作准备。那么什么是多态呢?
方法的重写 ......
最近在开发一个小的ESB系统,会在这里粘一些觉得会用的到的文章。
出自:www.ibm.com.cn MattTowers 2002年10月08日
摘要
使用 HTTPS(Hypertext Transfer Protocol Secure 安全超文本传输协议)并非你所想的那样简单直接。如果你曾经尝试在 Java 客户端和 HTTPS 服务器之间进行安全的通 ......
了解缺省Locale是由操作系统决定的,Locale是由语言和国家代码组成
国际化资源文件由baseName+locale组成,如:MessageBundle_en_US.properties(baseName是任意合法的文件名)
native2ascii命令的位置和用法
位置:JAVA_HOME/bin
使用native2ascii.exe o.properties MessagesBundle_zh_CN.properties 命令对整个文件 ......