Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A collection of Java libraries for connecting securely to Cloud SQL

License

NotificationsYou must be signed in to change notification settings

GoogleCloudPlatform/cloud-sql-jdbc-socket-factory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

CI

The Cloud SQL Connector for Java is a library that provides IAM-based authorization and encryption when connecting to a Cloud SQL instance. It cannot provide a network path to a Cloud SQL instance if one is not already present. See theConnecting Overview page for more information on connecting to a Cloud SQL instance.

Usage

For usage information specific to your database engine and driver, see the pages below:

For examples of this library being used in the context of an application, check out the sample applications locatedhere.

Authentication

This library uses theApplication Default Credentials (ADC) strategy forresolving credentials. Please seethese instructions for how to set your ADC(Google Cloud Application vs Local Development, IAM user vs service account credentials).

---

Building the Drivers

To build a fat JAR containing the JDBC driver with the bundles Socket Factory dependencies you can issue the following Maven command from the location containing the project pom.xml:

mvn -P jar-with-dependencies clean package -DskipTests

This will create atarget sub-folder within each of the module directories. Within these target directories you'll find the JDBC driver files.

Example:

mysql-socket-factory-connector-j-8–1.8.0-jar-with-dependencies.jarpostgres-socket-factory-1.8.0-jar-with-dependencies.jar

Debug Logging

The Java Connector supports optional debug logging to help diagnose problems withthe background certificate refresh. To enable it, add the following to the file/src/main/resources/application.yml:

logging.level.root=DEBUG

Firewall configuration

The Cloud SQL proxy establishes connections to Cloud SQL instances using port 3307. Applicationsthat are protected by a firewall may need to be configured to allow outgoing connections on TCP port3307. A connection blocked by a firewall typically results in an error stating connection failure(e.g.com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure).

Connect with IntelliJ

In order toconnect IntelliJto your Cloud SQL instance, you will need to add this library as a jar with dependencies in"Additional Files" section on the driver settings page. Prebuilt fat jars are no longer provided (since v1.14.0).

Troubleshooting

Here are some troubleshooting tips to resolve common issues that come up when using the Java Connector:

  1. Make sure you are using the latest version of the Cloud SQL Connector and your database driver to avoid incompatibilities. Some older versions of drivers are not supported.
  2. The Java connector provides authorization for connections, but it does not provide new paths to connectivity. For example, in order to connect to a Cloud SQL instance using a Private IP address, your application must already have VPC access.

Support policy

Major version lifecycle

This project usessemantic versioning, and uses thefollowing lifecycle regarding support for a major version:

Active - Active versions get all new features and security fixes (thatwouldn’t otherwise introduce a breaking change). New major versions areguaranteed to be "active" for a minimum of 1 year.Deprecated - Deprecated versions continue to receive security and criticalbug fixes, but do not receive new features. Deprecated versions will be publiclysupported for 1 year.Unsupported - Any major version that has been deprecated for >=1 year isconsidered publicly unsupported.

Supported JDK versions

We test and support at minimum, any publically supported LTS JDK version.Changes in supported versions will be considered a minor change, and will belisted in the realease notes.

Release cadence

This project aims for a minimum monthly release cadence. If no newfeatures or fixes have been added, a new PATCH version with the latestdependencies is released.

About

A collection of Java libraries for connecting securely to Cloud SQL

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp