Created
June 11, 2015 10:26
-
-
Save tjlee/0dc9505a1e0c6371bcde to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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