Skip to content

Instantly share code, notes, and snippets.

@tjlee
Created June 11, 2015 10:26
Show Gist options
  • Save tjlee/0dc9505a1e0c6371bcde to your computer and use it in GitHub Desktop.
Save tjlee/0dc9505a1e0c6371bcde to your computer and use it in GitHub Desktop.
public boolean checkGiftCardStatus(String code, CardStatus status) throws TestException {
try {
Connection conn = getCentrumConnection(SET);
String sql = "SELECT * FROM card_cards WHERE numberfield = ? ";
PreparedStatement st = conn.prepareStatement(sql);
st.setString(1, code);
ResultSet rs = st.executeQuery();
boolean exist = false;
while (rs.next()) {
exist = rs.getInt("status") == status.ordinal();
}
return exist;
} catch (SQLException e) {
throw new TestException("Ошибка при получении статуса подарочной карты на сервере", e);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment