Skip to content

Commit

Permalink
Clarify host parameter is optional in the README. (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtisvg authored Dec 2, 2019
1 parent 7de0684 commit 7f59cc7
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ compile 'com.google.cloud.sql:postgres-socket-factory:1.0.15'

##### MySQL

Base JDBC url: `jdbc:mysql://google/<DATABASE_NAME>`
Base JDBC URL: `jdbc:mysql:///<DATABASE_NAME>`

When specifying the JDBC connection URL, add the additional parameters:

Expand All @@ -91,14 +91,16 @@ When specifying the JDBC connection URL, add the additional parameters:
| user | MySQL username |
| password | MySQL user's password |

The full JDBC url should look like this:
The full JDBC URL should look like this:
```
jdbc:mysql://google/<DATABASE_NAME>?cloudSqlInstance=<INSTANCE_CONNECTION_NAME>&socketFactory=com.google.cloud.sql.mysql.SocketFactory&useSSL=false&user=<MYSQL_USER_NAME>&password=<MYSQL_USER_PASSWORD>
jdbc:mysql:///<DATABASE_NAME>?cloudSqlInstance=<INSTANCE_CONNECTION_NAME>&socketFactory=com.google.cloud.sql.mysql.SocketFactory&useSSL=false&user=<MYSQL_USER_NAME>&password=<MYSQL_USER_PASSWORD>
```

Note: The host portion of the JDBC URL is currently unused, and has no effect on the connection process. The SocketFactory will get your instances IP address base on the provided `cloudSqlInstance` arg.

##### Postgres

Base JDBC url: `jdbc:postgresql://google/<DATABASE_NAME>`
Base JDBC URL: `jdbc:postgresql:///<DATABASE_NAME>`

When specifying the JDBC connection URL, add the additional parameters:

Expand All @@ -109,10 +111,13 @@ When specifying the JDBC connection URL, add the additional parameters:
| user | Postgres username |
| password | Postgres user's password |

The full JDBC url should look like this:
The full JDBC URL should look like this:
```
jdbc:postgresql://google/<DATABASE_NAME>?cloudSqlInstance=<INSTANCE_CONNECTION_NAME>&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=<POSTGRESQL_USER_NAME>&password=<POSTGRESQL_USER_PASSWORD>
jdbc:postgresql:///<DATABASE_NAME>?cloudSqlInstance=<INSTANCE_CONNECTION_NAME>&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=<POSTGRESQL_USER_NAME>&password=<POSTGRESQL_USER_PASSWORD>
```

Note: The host portion of the JDBC URL is currently unused, and has no effect on the connection process. The SocketFactory will get your instances IP address base on the provided `cloudSqlInstance` arg.

---

## Building the Drivers
Expand Down

0 comments on commit 7f59cc7

Please sign in to comment.