示例#1
0
  public boolean delete(Exchange entity) throws StockPlayException {
    Connection conn = null;
    PreparedStatement stmt = null;
    ResultSet rs = null;
    try {
      try {
        conn = OracleConnection.getConnection();
        stmt = conn.prepareStatement(DELETE_EXCHANGE);

        stmt.setString(1, entity.getSymbol());

        return stmt.executeUpdate() == 1;

      } finally {
        if (rs != null) {
          rs.close();
        }
        if (stmt != null) {
          stmt.close();
        }
        if (conn != null) {
          conn.close();
        }
      }
    } catch (SQLException ex) {
      throw new SubsystemException(SubsystemException.Type.DATABASE_FAILURE, ex.getCause());
    }
  }