下面代码不知道你是不是能用得上。        try{
          conn=ConnDB.getConnection();
          conn.setAutoCommit(false);
          st=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
          String sql = "INSERT INTO TEAM(TEAM_ID,TEAM_NAME) VALUES ('" + teamid + "','" + teamname + "');";
          st.execute(sql);     }
     catch(SQLException e){
       conn.rollback();
       e.printStackTrace();
       request.setAttribute("errCode",Integer.toString(e.getErrorCode()));
       throw new SQLException(e.getMessage());
          }
     finally{
            conn.commit();
            st.close();
            conn.close();
            }