2016-11-07 93 views

回答

3

在构建服务时尝试使用setCredentials和ServiceAccountCredentials.fromStream。

BigQuery bigquery = BigQueryOptions.newBuilder() 
    .setCredentials(
     ServiceAccountCredentials.fromStream(newFileInputStream("your_json_service_keyfile.json")) 
    ).build().getService() 

这应该在Google的API文档中有更好的记录。

希望它有帮助,这是我在stackoverflow上的第一个答案:-)

相关问题