コード例 #1
0
ファイル: Db_outils.java プロジェクト: Romlatome/TP1-SD
  public int Get_Identifiant(Connection connection, String id) throws Exception {
    CallableStatement cs = null;
    try {
      Connexion cnx = new Connexion();
      cnx.setConnexion();
      connection = cnx.getConnexion();
      cs = connection.prepareCall("{? = call inc_parametre(?)}");
      cs.registerOutParameter(1, Types.INTEGER);
      cs.setString(2, id);
      cs.execute();
      return (cs.getInt(1));

    } catch (Exception e) {
      throw e;
    } finally {
      try {
        if (cs != null) cs.close();
      } catch (Exception e) {
        throw e;
      }
    }
  }