Preparation, patterning and critical current density of YBa2Cu3O7−δ thin films