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³ÌÐò£¬ÎÞÂÛÊÇδ´ò°üµÄ»¹ÊÇ´ò°üµÄJAR»òWARÎļþ£¬ÓÐʱºò¶¼ÐèÒª»ñÈ¡ËüÔËÐÐËùÔÚĿ¼ÐÅÏ¢£¬ÈçºÎ×öµ½ÕâÒ»µãÄØ£¿
ÔÚJava´¦ÀíµÄÎļþϵͳÖУ¬Ä¿Â¼µÄ±íʾ·½Ê½ÓÐÁ½ÖÖ£º
£¨1£©¾ø¶ÔĿ¼£¬ËüÒÔ"/"ΪÆðʼ×Ö·û£¬´ú±í´Ó¸ùĿ¼Ï¿ªÊ¼Ñ°ÕÒ¸ø³öµÄĿ¼£¬Èç/c:/java
£¨2£©Ïà¶Ô·¾¶£¬ËüÒÔ²»´ø“/”µÄĿ¼Ãû±íʾ£¬±íʾÒÔµ±Ç ......
¶îÍâ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 ......
ÃæÏò¶ÔÏó±à³ÌÓÐÈý¸öÌØÕ÷£¬¼´·â×°¡¢¼Ì³ÐºÍ¶à̬¡£
·â×°Òþ²ØÁËÀàµÄÄÚ²¿ÊµÏÖ»úÖÆ£¬´Ó¶ø¿ÉÒÔÔÚ²»Ó°ÏìʹÓÃÕßµÄǰÌáϸıäÀàµÄÄÚ²¿½á¹¹£¬Í¬Ê±±£»¤ÁËÊý¾Ý¡£
¼Ì³ÐÊÇΪÁËÖØÓø¸Àà´úÂ룬ͬʱΪʵÏÖ¶à̬ÐÔ×÷×¼±¸¡£ÄÇôʲôÊǶàÌ¬ÄØ£¿
·½·¨µÄÖØÐ´ ......
System.out.println(2|0); //0010 0000 =>0010 = 2
System.out.println(2|1); //0010 0001 =>0011 = 3
System.out.println(3|2); //0011 0010 =>0011 = 3
System.out.println(3&2); //0011 0010 =>0010 = 2
/*
ÔÚjavaÖÐ0´ú±í¼Ù, 1´ú±íÕæ
00011|0010 ´ÓÓÒµ½×ó±È½Ï0|1 = 1, 1|0 = ......