易截截图软件、单文件、免安装、纯绿色、仅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自定义多线程服务器

// multi.MultiServer.java
package multi;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
public class MultiServer {
private int port = 8000;
private int backlog = 42;
private ServerSocket server_socket;
private Thread ......

java 解压缩zip文件

测试环境:win2000+jdk1.4+jb2006
 import java.io.*;
import java.util.Enumeration;
//import java.util.zip.*;
import org.apache.tools.zip.*;
public class Test {
//解压文件
  public static void extZipFileList(String zipFileName, String extPlace) {
    try {
   ......

Java作业02

package homework02;
import java.util.Scanner;
/*
* 编写两个类:A和B,类A创建的对象可以计算两个正整数的最大公约数,类B创建的
* 对象可以计算两个数的最小公倍数。要求:类B中有一个成员变量时用类A的声明对象。
*/
public class A {
private int m;
private int n;
public A(){
this.intput();
......

JAVA国际化


了解缺省Locale是由操作系统决定的,Locale是由语言和国家代码组成
国际化资源文件由baseName+locale组成,如:MessageBundle_en_US.properties(baseName是任意合法的文件名)
native2ascii命令的位置和用法
位置:JAVA_HOME/bin
使用native2ascii.exe o.properties MessagesBundle_zh_CN.properties 命令对整个文件 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号