我不了解你说的,
不过你好象需要PreparedStatement

解决方案 »

  1.   

    setAutoCommit(false);原来是这么回事。
      

  2.   

    如果没有用setAutoCommit(false)那么我自己写的事务是不是会被分成一条条的sql语句执行并提交?
      

  3.   

    boolean autoCommit=connect.getAutoCommit();
    connect.setAutoCommit(false);connect.commit();
    connect.setAutoCommit(autoCommit);
      

  4.   

    如果我想通过jdbc执行以下事务该如何写jdbc:begin transaction
    insert .......... values.......
    insert .......... values .......
    if @@error=0
        commit transaction
    else
        rollback transaction
      

  5.   

    try{
        ……  
        con.setAutoCommit(false);
        ……  //执行你的任务
        ……
        con.commit();
        con.setAutoCommit(true);}catch(SQLException ex) {
        System.err.println("SQLException: " + ex.getMessage());
            if (con != null) {
      try {
        System.err.print("Transaction is being ");
        System.err.println("rolled back");
        con.rollback();
       } catch(SQLException excep) {
    System.err.print("SQLException: ");
    System.err.println(excep.getMessage());
    }
    }
    }
      

  6.   

    你有没有JDK1.2.2的帮助文档呢?看JDK1.2.2的帮助手册!!!上面对方法的描述很详细的!