Code example for Connection

Methods: prepareStatement

0
    } 
 
    @Override 
    public void upgrade(Connection connection) throws IOException, SQLException {
 
        int moratoriumRepaymentLookupRuleId = insertLookupValue(connection, 91, "RepaymentRule-RepaymentMoratorium");
 
        insertIntoRepaymentRuleLookup(connection,4, moratoriumRepaymentLookupRuleId);
    } 
 
    private void insertIntoRepaymentRuleLookup(Connection connection,int repaymentRuleId, int lookUpId )
                    throws SQLException { 
        String sql = "insert into repayment_rule (repayment_rule_id, repayment_rule_lookup_id) values (?,?)";
        PreparedStatement statement = connection.prepareStatement(sql);
        statement.setInt(1,repaymentRuleId);
        statement.setInt(2, lookUpId);
        statement.execute();
    } 
 
}