protected void setParametersToStatement(PreparedStatement statement, Object[] params) throws SQLException {
        if (params != null) {
            int i;

            for (i = 0; i < params.length; i++) {
                if (params[i] instanceof UUID) {
                    statement.setString(i + 1, (params[i]).toString());
                } else if (params[i] instanceof String) {
                    statement.setString(i + 1, params[i].toString());
                } else if (params[i] instanceof Boolean) {
                    statement.setBoolean(i + 1, Boolean.parseBoolean(params[i].toString()));
                } else if (params[i] instanceof Integer) {
                    statement.setInt(i + 1, Integer.parseInt(params[i].toString()));
                } else if (params[i] instanceof Character) {
                    statement.setInt(i + 1, params[i].toString().charAt(0));
                } else if (params[i] instanceof java.util.Date) {
                    statement.setDate(i + 1, new java.sql.Date( ((java.util.Date)params[i]).getTime()));
                } else if (params[i] instanceof java.sql.Date) {
                    statement.setDate(i + 1, (java.sql.Date)params[i]);
                } else {
                    statement.setObject(i + 1, params[i]);
                }
            }
        }
    }