耐心无止境 成功一瞬间

BlogJava 联系 聚合 管理
  31 Posts :: 5 Stories :: 25 Comments :: 0 Trackbacks
CallableStatement cstmt = null;
  int affectedRows = -1;
  int sequence = -1;
  try {
   cstmt = conn.prepareCall("{call portal_get_sequence(?,?,?)}");
   cstmt.setString(1, tableName);
   cstmt.setString(2, columnName);
   cstmt.registerOutParameter(3, Types.INTEGER);
   affectedRows = cstmt.executeUpdate();
   sequence = cstmt.getInt(3);
  } catch (SQLException e) {
   e.printStackTrace();
  } catch (Exception e) {
   e.printStackTrace();
  } finally {
   try {
    if (cstmt != null) {
     cstmt.close();
    }
   } catch (SQLException e) {
    // e.printStackTrace();
    System.err.println(e.getMessage());
   }
  }
posted on 2005-10-11 13:18 Joshua Yan 阅读(227) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: