Skip to content

Commit 9466c84

Browse files
vkediagarrettjonesgoogle
authored andcommitted
---
yaml --- r: 8599 b: refs/heads/master c: a93e3e3 h: refs/heads/master i: 8597: ff954da 8595: 6b86c22 8591: 212e4ff
1 parent 07aeb0c commit 9466c84

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 029b8da8df914135807ae8104adcb2f56634c67a
2+
refs/heads/master: a93e3e37f94822ec60e49f53f0d40421005e739d
33
refs/heads/travis: 47e4fee4fd5af9b2a8ce46f23c72ec95f9b195b2
44
refs/heads/gh-pages: 6daca92127d91b7c2c99490080ecf8a13fa94cde
55
refs/tags/0.0.9: 22f1839238f66c39e67ed4dfdcd273b1ae2e8444

trunk/google-cloud-spanner/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,15 @@ try {
8585
DatabaseClient dbClient = spanner.getDatabaseClient(
8686
DatabaseId.of(options.getProjectId(), instance, database));
8787
// Queries the database
88-
ResultSet resultSet = dbClient.singleUse().executeQuery(Statement.of("SELECT 1"));
89-
// Prints the results
90-
while (resultSet.next()) {
91-
System.out.printf("%d\n", resultSet.getLong(0));
88+
try (ResultSet resultSet = dbClient.singleUse().executeQuery(Statement.of("SELECT 1"))) {
89+
// Prints the results
90+
while (resultSet.next()) {
91+
System.out.printf("%d\n", resultSet.getLong(0));
92+
}
9293
}
9394
} finally {
9495
// Closes the client which will free up the resources used
95-
spanner.closeAsync().get();
96+
spanner.close();
9697
}
9798
```
9899

0 commit comments

Comments
 (0)