/sqldev-jdbc-proxy

JDBC driver for SQL Developer that can delegate MySQL requests to Snowflake, PostgreSQL, SQLite, H2 and MySQL.

Primary LanguageJavaApache License 2.0Apache-2.0

JDBC Proxy for SQL Developer

Introduction

This JDBC driver is mimicking a MySQL driver. As a result it can be configured as third party JDBC driver in Oracle SQL Developer to access the following databases:

SQL Developer provides a reduced functionality for non Oracle Databases. This driver allows you to connect to these databases and use the features for MySQL within SQL Developer.

What Does the JDBC Proxy Besides Delegating Calls?

The proxy driver rewrites some SQL statements to the SQL dialect of the target database. This ensures that the statements executed during navigation in the Connections window are understood by the target driver, and a meaningful result is returned.

The rewritten SQL is processed by the target JDBC driver, and the result is presented by SQL Developer which thinks it is talking to a MySQL database.

Releases

Binary releases are published here.

Installation

  1. Download the driver (e.g. jdbc-proxy-0.1.0.zip from the release page)

  2. Unzip the downloaded file in a folder of your choice

  3. Register the jdbc-proxy-0.1.0.jar file in the "Third Party JDBC Drivers" section of the SQL Developer preferences as shown in the following screenshot

    SQL Developer Preferences

    Please ensure that the proxy driver is the first driver in the list. Restart SQL Developer, if you had to change the order of the JDBC drivers.

Using the Driver

The full syntax of a JDBC URL supported by the JDBC proxy driver looks as follows:

jdbc:mysql:<target-jdbc-url>:[<port>]/[database]

This looks like a MySQL JDBC URL, because the proxy driver is mimicking a MySQL JDBC driver. However, the part which contains the hostname in a MySQL URL contains now a <target-jdbc-url>. This <target-jdbc-url> has to be entered in the "Hostname" field of the "New / Select Database Connection" dialog in SQL Developer.

SQL Developer New Database Connection

Only the values for "Username", "Password" and "Hostname" are used to build the JDBC URL. Therefore, you have to provide everything you need as URL parameters. Here are some examples for "Hostname" values:

Target Database JDBC URL (in Hostname) Notes
Snowflake jdbc:snowflake://<account>.snowflakecomputing.com:443/?db=toucan_db&warehouse=toucan_wh&schema=toucan_schema&role=training_role Properties db, warehouse, schema and role are set in the URL.
PostgreSQL jdbc:postgresql://localhost:5432/postgres No additional properties configured.
SQLite jdbc:sqlite:/Users/phs/sqldev_sqlite.db No additional properties supported.
H2 jdbc:h2:/Users/phs/h2testphs No additional properties supported.
MySQL jdbc:mysql://localhost:3306/public?zeroDateTimeBehavior=CONVERT_TO_NULL Property zeroDateTimeBehavior is set in the URL. The default is EXCEPTION, which is overridden by SQL Developer.

Issues

Please file your bug reports, enhancement requests, questions and other support requests within Github's issue tracker.

How to Contribute

  1. Describe your idea by submitting an issue
  2. Fork the utPLSQL-SQLDeveloper repository
  3. Create a branch, commit and publish your changes and enhancements
  4. Create a pull request

How to Build

  1. Download and install SQL Developer 20.2.0

  2. Download and install Apache Maven 3.6.3

  3. Download and install a git command line client

  4. Clone this repository

  5. Open a terminal window in the project's root folder and run the maven build:

    mvn -Dsqldev.basedir=/Applications/SQLDeveloper20.2.0.app/Contents/Resources/sqldeveloper -DskipTests=true clean package

    Amend the parameter sqldev.basedir to match the path of your SQL Developer installation. This folder is used to reference Oracle jar files which are not available in public Maven repositories.

  6. The resulting file jdbc-proxy-x.x.x-SNAPSHOT.zip in the target directory contains the proxy and all target JDBC drivers.

License

JDBC Proxy for SQL Developer is licensed under the Apache License, Version 2.0. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.