Using JDBC client (Squirrel SQL), we have tried to connect to Spanner instance. But we ended up in an issue.
- Before experimenting Spanner, we tried to connect AWS aurora mysql DB with Squirrel SQL through mysql JDBC driver. It was successful and we are able to run queries on DB.
- Cloud spanner JDBC driver has been accepted by Squirrel SQL without any issue.
- There is a connection error even when all the parameters are fed correctly to the driver.
- As per Spanner's JDBC documentation, host is given as "localhost", it will be used just as a placeholder by squirrel SQL, but JDBC will neglect it.
- Project ID, instance name and DB name are taken from the cloud spanner instance
- Connection fails with DNS error.
There is no useful online documentation explaining the usage of spanner's JDBC makes it very difficult to figure out the issue with the connection.
Our concern is with using "localhost" as a base address. But the documentations direct us to do so. https://github.com/olavloite/spanner-jdbc/wiki/URL-and-Connection-Properties