private static PreparedStatement setParametersInPreparedStatement(
        PreparedStatement preparedStatement, Object... parameters) throws SQLException {
        int i = 1;
        for (Object parameter : parameters) {
            if (parameter instanceof String) {
                preparedStatement.setString(i, (String) parameter);
            } else if (parameter instanceof Integer) {
                preparedStatement.setInt(i, (Integer) parameter);
            } else if (parameter instanceof Long) {
                preparedStatement.setLong(i, (Long) parameter);
            } else if (parameter instanceof Float) {
                preparedStatement.setFloat(i, (Float) parameter);
            } else if (parameter instanceof Double) {
                preparedStatement.setDouble(i, (Double) parameter);
            } else if (parameter instanceof Date) {
                preparedStatement.setDate(i, (Date) parameter);
            } else if (parameter instanceof Blob) {
                preparedStatement.setBlob(i, (Blob) parameter);
            }
            i++;
        }
        return preparedStatement;
    }