Created
May 16, 2019 11:44
-
-
Save oludouglas/16be7ea6455c1ea67d6c357106d97c49 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 isProductPermitted(String acctNo) { | |
try (Statement stmt = MobileControl.handles[connIndex].createStatement()) { | |
StringBuilder builder = new StringBuilder("select b.prod_cd from ").append(MainClass.CORE_SCHEMA) | |
.append(".account a, ").append(MainClass.CORE_SCHEMA) | |
.append(".product b where a.prod_id = b.prod_id and trim(a.acct_no) = '").append(acctNo) | |
.append("' and rec_st = 'A' and b.prod_cd in ("); | |
for (String prod : MainClass.ALLOWED_PRODUCTS_CODES) { | |
builder.append("'").append(prod).append("',"); | |
} | |
try (ResultSet rset = stmt.executeQuery(builder.substring(0, builder.lastIndexOf(",")) + ")")) { | |
return rset.next(); | |
} | |
} catch (SQLException e) { | |
RubiLog.getLogger().error(e); | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment