Skip to content

Commit 4f899e5

Browse files
authored
Release v1.0.10 (#87)
* Bump version numbers. * Update README.
1 parent 71b66ac commit 4f899e5

File tree

7 files changed

+93
-64
lines changed

7 files changed

+93
-64
lines changed

README.md

Lines changed: 78 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,93 +2,120 @@
22
Status](https://travis-ci.org/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory.svg?branch=master)](https://travis-ci.org/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory)
33
## Cloud SQL Socket Factory for JDBC drivers
44

5-
The Cloud SQL Socket Factory is a library for the MySQL/Postgres JDBC drivers
6-
that allows a user with the appropriate permissions to connect to a Cloud SQL
7-
database without having to deal with IP whitelisting or SSL certificates
8-
manually.
5+
The Cloud SQL Socket Factory is a library for the MySQL/Postgres JDBC drivers that allows a user
6+
with the appropriate permissions to connect to a Cloud SQL database without having to deal with IP
7+
whitelisting or SSL certificates manually.
98

109
## Instructions
1110

12-
The library is [available in Maven Central](http://search.maven.org/#artifactdetails%7Ccom.google.cloud.sql%7Cmysql-socket-factory%7C1.0.4%7Cjar).
11+
This library is available
1312

14-
Add a dependency using your favorite build tool. Maven and Gradle examples are shown below.
13+
[Maven Central](http://search.maven.org/#artifactdetails%7Ccom.google.cloud.sql%7Cmysql-socket-factory%7C1.0.4%7Cjar).
1514

1615

17-
### MySQL
16+
### Authentication
1817

19-
**Note**: If you wish to use the 6.x (development) version of the MySQL driver, use the artifact id
20-
'mysql-socket-factory-connector-j-6'.
18+
This library uses the [Application Default Credentials](
19+
https://developers.google.com/identity/protocols/application-default-credentials) to authenticate
20+
the connection to the Cloud SQL server. For more details, see the previously mentioned link.
2121

22-
#### Adding dependency (Maven)
22+
To activate credentials locally, use the following [gcloud](https://cloud.google.com/sdk/gcloud/)
23+
command:
24+
```bash
25+
gcloud auth application-default login
26+
```
27+
28+
### Add library as a dependency
29+
30+
#### MySQL
31+
32+
**Note**: Use the correct version to match your JDBC driver:
33+
34+
| JDBC Driver Version | Cloud SQL Socket Factory Version |
35+
| -------------------------- | ---------------------------------------- |
36+
| mysql-connector-java:8.x | mysql-socket-factory-connector-j8:1.0.10 |
37+
| mysql-connector-java:6.x | mysql-socket-factory-connector-j6:1.0.10 |
38+
| mysql-connector-java:5.1.x | mysql-socket-factory:1.0.10 |
2339

40+
41+
##### Maven
42+
Include the following in the project's `pom.xml`:
2443
```maven-pom
2544
<dependency>
2645
    <groupId>com.google.cloud.sql</groupId>
27-
    <artifactId>mysql-socket-factory</artifactId>
28-
    <version>1.0.9</version>
46+
    <artifactId>mysql-socket-factory-connector-j8</artifactId>
47+
    <version>1.0.10</version>
2948
</dependency>
3049
```
3150

32-
#### Adding dependency (Gradle)
33-
51+
#### Gradle
52+
Include the following the project's `gradle.build`
3453
```gradle
35-
compile 'com.google.cloud.sql:mysql-socket-factory:1.0.9'
54+
compile 'com.google.cloud.sql:mysql-socket-factory:1.0.10'
3655
```
3756

38-
#### Using
39-
40-
When specifying the JDBC connection URL, add two additional parameters:
41-
42-
| Property | Value |
43-
| ---------------- | ------------- |
44-
| socketFactory | com.google.cloud.sql.mysql.SocketFactory |
45-
| cloudSqlInstance | The instance connection name (which is found on the instance details page in Google Developers Console) |
46-
47-
For example, if the instance connection name is `foo:bar:baz`, the JDBC URL
48-
would be
49-
`jdbc:mysql://google/mydb?socketFactory=com.google.cloud.sql.mysql.SocketFactory&cloudSqlInstance=foo:bar:baz`
50-
51-
A tool is available in `examples/getting-started` that can help generate the JDBC URL and verify that connectivity can be established.
52-
53-
### PostgreSQL
54-
55-
#### Adding dependency (Maven)
57+
#### PostgreSQL
5658

59+
##### Maven
60+
Include the following in the project's `pom.xml`:
5761
```maven-pom
5862
<dependency>
5963
    <groupId>com.google.cloud.sql</groupId>
60-
    <artifactId>postgres-socket-factory</artifactId>
61-
    <version>1.0.9</version>
64+
    <artifactId>mysql-socket-factory</artifactId>
65+
    <version>1.0.1o</version>
6266
</dependency>
6367
```
6468

65-
#### Adding dependency (Gradle)
66-
69+
#### Gradle
70+
Include the following the project's `gradle.build`
6771
```gradle
68-
compile 'com.google.cloud.sql:postgres-socket-factory:1.0.9'
72+
compile 'com.google.cloud.sql:mysql-socket-factory:1.0.10'
6973
```
7074

71-
#### Using
7275

73-
When specifying the JDBC connection URL, add two additional parameters:
76+
#### Creating the JDBC URL
77+
78+
##### MySQL
79+
80+
Base JDBC url: `jdbc:mysql://google/<DATABASE_NAME>`
81+
82+
When specifying the JDBC connection URL, add the additional parameters:
7483

7584
| Property | Value |
7685
| ---------------- | ------------- |
7786
| socketFactory | com.google.cloud.sql.postgres.SocketFactory |
78-
| socketFactoryArg | The instance connection name (which is found on the instance details page in Google Developers Console) |
87+
| socketFactoryArg | The instance connection name (found on the instance details) |
88+
| useSSL | False |
89+
| user | MySQL username |
90+
| password | MySQL user's password |
91+
92+
The full JDBC url should look like this:
93+
```
94+
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>
95+
```
7996

80-
For example, if the instance connection name is `foo:bar:baz`, the JDBC URL
81-
would be
82-
`jdbc:postgresql://google/mydb?socketFactory=com.google.cloud.sql.postgres.SocketFactory&socketFactoryArg=foo:bar:baz`
97+
##### Postgres
8398

84-
A tool is available in `examples/getting-started` that can help generate the JDBC URL and verify that connectivity can be established.
99+
Base JDBC url: `jdbc:mysql://google/<DATABASE_NAME>`
85100

86-
## Credentials
101+
When specifying the JDBC connection URL, add the additional parameters:
102+
103+
| Property | Value |
104+
| ---------------- | ------------- |
105+
| socketFactory | com.google.cloud.sql.postgres.SocketFactory |
106+
| socketFactoryArg | The instance connection name (which is found on the instance details page in Google Developers Console) |
107+
| user | Postgres username |
108+
| password | Postgres user's password |
109+
110+
The full JDBC url should look like this:
111+
```
112+
jdbc:postgresql://google/<DATABASE_NAME>?useSSL=false&socketFactoryArg=<INSTANCE_CONNECTION_NAME>&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=<POSTGRESQL_USER_NAME>&password=<POSTGRESQL_USER_PASSWORD>
113+
```
87114

88-
The library needs to obtain credentials in order to retrieve SSL certificates that are used to connect to the instance.
89-
[Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials) are used for this purpose.
115+
## Connecting via Unix Sockets
90116

91-
On Google Compute Engine and Google App Engine, the VM/application service account is used.
117+
The library will automatically detect when it is running on GAE Standard, and will connect via the
118+
provided unix socket for reduced latency.
92119

93-
For local development, application default credentials written by gcloud are used, if present.
94-
You must run `gcloud auth application-default login` once for the credentials to become available to the library.
120+
To force the library to connect to a unix socket (created by the Cloud SQL proxy) when running
121+
outside of GAE-Standard, set the environment variable `CLOUD_SQL_FORCE_UNIX_SOCKET` to any value.

connector-j-5/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.google.cloud.sql</groupId>
77
<artifactId>jdbc-socket-factory-parent</artifactId>
8-
<version>1.0.10-SNAPSHOT</version>
8+
<version>1.0.10</version>
99
</parent>
1010
<artifactId>mysql-socket-factory</artifactId>
1111
<packaging>jar</packaging>
@@ -21,13 +21,13 @@
2121
<dependency>
2222
<groupId>mysql</groupId>
2323
<artifactId>mysql-connector-java</artifactId>
24-
<version>5.1.45</version>
24+
<version>5.1.46</version>
2525
<scope>provided</scope>
2626
</dependency>
2727
<dependency>
2828
<groupId>com.google.cloud.sql</groupId>
2929
<artifactId>jdbc-socket-factory-core</artifactId>
30-
<version>1.0.9</version>
30+
<version>1.0.10</version>
3131
</dependency>
3232
<dependency>
3333
<groupId>com.github.jnr</groupId>

connector-j-6/pom.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.google.cloud.sql</groupId>
77
<artifactId>jdbc-socket-factory-parent</artifactId>
8-
<version>1.0.10-SNAPSHOT</version>
8+
<version>1.0.10</version>
99
</parent>
1010
<artifactId>mysql-socket-factory-connector-j-6</artifactId>
1111
<packaging>jar</packaging>
@@ -22,11 +22,12 @@
2222
<groupId>mysql</groupId>
2323
<artifactId>mysql-connector-java</artifactId>
2424
<version>6.0.6</version>
25+
<scope>provided</scope>
2526
</dependency>
2627
<dependency>
2728
<groupId>com.google.cloud.sql</groupId>
2829
<artifactId>jdbc-socket-factory-core</artifactId>
29-
<version>1.0.9</version>
30+
<version>1.0.10</version>
3031
</dependency>
3132
<dependency>
3233
<groupId>org.eclipse.jetty</groupId>

connector-j-8/pom.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.google.cloud.sql</groupId>
77
<artifactId>jdbc-socket-factory-parent</artifactId>
8-
<version>1.0.10-SNAPSHOT</version>
8+
<version>1.0.10</version>
99
</parent>
1010
<artifactId>mysql-socket-factory-connector-j-8</artifactId>
1111
<packaging>jar</packaging>
@@ -22,11 +22,12 @@
2222
<groupId>mysql</groupId>
2323
<artifactId>mysql-connector-java</artifactId>
2424
<version>8.0.11</version>
25+
<scope>provided</scope>
2526
</dependency>
2627
<dependency>
2728
<groupId>com.google.cloud.sql</groupId>
2829
<artifactId>jdbc-socket-factory-core</artifactId>
29-
<version>1.0.8</version>
30+
<version>1.0.10</version>
3031
</dependency>
3132
<dependency>
3233
<groupId>org.eclipse.jetty</groupId>

core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.google.cloud.sql</groupId>
77
<artifactId>jdbc-socket-factory-parent</artifactId>
8-
<version>1.0.10-SNAPSHOT</version>
8+
<version>1.0.10</version>
99
</parent>
1010
<artifactId>jdbc-socket-factory-core</artifactId>
1111
<packaging>jar</packaging>

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<groupId>com.google.cloud.sql</groupId>
66
<artifactId>jdbc-socket-factory-parent</artifactId>
77
<packaging>pom</packaging>
8-
<version>1.0.10-SNAPSHOT</version>
8+
<version>1.0.10</version>
99

1010
<name>Cloud SQL JDBC Socket Factory</name>
1111
<description>
@@ -65,8 +65,8 @@
6565
<configuration>
6666
<compilerId>javac-with-errorprone</compilerId>
6767
<forceJavacCompilerUse>true</forceJavacCompilerUse>
68-
<source>1.7</source>
69-
<target>1.7</target>
68+
<source>1.8</source>
69+
<target>1.8</target>
7070
</configuration>
7171
<dependencies>
7272
<dependency>

postgres/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.google.cloud.sql</groupId>
77
<artifactId>jdbc-socket-factory-parent</artifactId>
8-
<version>1.0.10-SNAPSHOT</version>
8+
<version>1.0.10</version>
99
<relativePath>..</relativePath>
1010
</parent>
1111

@@ -23,7 +23,7 @@
2323
<dependency>
2424
<groupId>com.google.cloud.sql</groupId>
2525
<artifactId>jdbc-socket-factory-core</artifactId>
26-
<version>1.0.10-SNAPSHOT</version>
26+
<version>1.0.10</version>
2727
</dependency>
2828
<dependency>
2929
<groupId>com.github.jnr</groupId>

0 commit comments

Comments
 (0)