* @param functionName Name of function
* @param functionBody Body of function
* @throws ApplicationException On failure
*/
public static void loadFunction(JdbcTemplateDao dao, PostgreSQLFunction dbFunction) throws ApplicationException {
JdbcTemplate jdbcTemplate = dao.getJdbcTemplate();
// initialize drop procedure, if database has been dropped
jdbcTemplate.execute(new ResourceUtil(DROP_FUNCTION.getURI()).getContent());
// drop previous function version, if necessary
jdbcTemplate.queryForInt("select util.drop_function( ?,? )",
dbFunction.getSchema(), dbFunction.getFunctionName());
// load new function body
jdbcTemplate.execute(new ResourceUtil(dbFunction.getURI()).getContent());
}