Bundling3rdPartyJDBCDriverJars

Task to bundle 3rd party JDBC Driver jar files in NetBeans

Contents


Issue tracking

 Feedback on this spec can be added to this issue.

Overview

To improve the out-of-box-experience for database development in NetBeans, the plan as described in this document is to =include 3rd party open source JDBC driver jar files in NetBeans 6 beta2.

The following drivers, MySQL® Connector/J 5.0.7 and Postgres 8.2-506 JDBC drivers (including license files for each jar file) are to be included with NetBeans.

There are two parts to this task.

  1. Integrate the libraries through a library wrapper module by following the 3rd party library conventions document
  2. Update the db module to support this task. See the Goals / User impact for the end result.

Goals / User impact

Currently, in the Services tab under the Drivers node, if Java DB is registered, there are 2 drivers listed (on Windows, there is a 3rd driver - JDBC-ODBC) as shown in the screenshot:

File:drivers_beta1_Bundling3rdPartyJDBCDriverJars.GIF

For Beta2 the new bundled drivers will appear under the Drivers node:

File:drivers_beta2_Bundling3rdPartyJDBCDriverJars.GIF

Also, to help the user create a connection, when choosing the Connect Using action, the New Connection dialog will have the Database URL format for the corresponding driver and driver class name filled in. The user can replace the server name, port number and schema or database name and the username and password:

File:new_connection_Bundling3rdPartyJDBCDriverJars.GIF

The Name dropdown in the screenshot above will also be pre-filled with the new additional drivers.

License files

NBM

  • When drivers need updating in the future, a structure for the Database drivers library wrapper module is to be prepared
  • The following are screenshots of updating the Database Drivers nbm

File:plugins_database_drivers_Bundling3rdPartyJDBCDriverJars.GIF File:database_drivers_install_dialog1_Bundling3rdPartyJDBCDriverJars.GIF File:database_drivers_license_agreement_Bundling3rdPartyJDBCDriverJars.GIF File:database_drivers_install_result_Bundling3rdPartyJDBCDriverJars.GIF File:database_drivers_plugins_Bundling3rdPartyJDBCDriverJars.GIF

Risks

  • None

Task breakdown

  • Feedback on this spec to be added to the Issue 116053
  • Approval of this spec, determined when all feedback addressed.
  • Add entry for this task to the Late UI Changes page, if needed and coordinate with Documentation and Usability team (for screenshot changes to Docs)
  • Work with Legal to make sure task is legal and license and OSR are taken care of
  • Ensure there is a License for each jar file
  • Include OSR with a CDDL license file
  • Follow the 3rd party library conventions document
  • Internal legal work to approve the bundling of jar files
  • Library wrapper implementation (see Changes required, below)
  • Drivers and licenses (as is) in the db module
  • Update cluster file and build script
  • Verify libraries are setup properly by running
    ant -f nbbuild/build.xml verify-libs-and-licenses
  • Add support to register the drivers which will allow the driver name, location and driver classname available to the Add Connection dialog
  • Test this task
  • Add information of this special feature to the appropriate web page on netbeans.org
  • Setup for Plugins for future updates to drivers


Jar files to bundle

  • mysql-connector-java-5.0.7-bin.jar
  • postgresql-8.2-506.jdbc3.jar

Changes required

Changes/Additions to make for the db module

  1. In the db module, create folders
    drivers/external
  2. Place driver jar and license text file in
    drivers/external
db_
   |_ drivers
            |_ external
                      |_ mysql-connector-java-5.0.7-bin.jar
                      |_ mysql-connector-java-5.0.7-bin-license.txt
                      |_ postgresql-8.2-504.jdbc3.jar
                      |_ postgresql-8.2-504.jdbc3-license.txt
  1. Also create one CDDL license file for the zip file
  2. Create one module wrapper for all drivers
  3. Update cluster.properties
  4. Update the db module to support this task :
  • Register an XML file for each driver, which describes the driver in the module layer. The XML file is described by the JDBC Driver DTD. An example of a registration file describing the JDBC driver for PostgreSQL follows:
    <!DOCTYPE driver PUBLIC '-//NetBeans//DTD JDBC Driver 1.0//EN' 'http://www.netbeans.org/dtds/jdbc-driver-1_0.dtd'>
    <driver>
      <!-- the name should be exactly 'JDBC-ODBC Bridge', since connections created in 4.1 will rely on it -->
      <name value='Postgres-7'/>
      <display-name value='PostgreSQL (v7.0 and later)'/>
      <class value='org.postgresql.Driver'/>
      <urls>
        <url value="jar:nbinst:///modules/ext/postgresql-8.2-506.jdbc3.jar!/"/>
      </urls>
    </driver>
  • This file should be registered in the
    Databases/JDBCDrivers
    folder of the module layer. To address a bundled JAR inside the IDE the nbinst protocol can be used in the URLs: {nbinst:/modules/ext/bundled-driver.jar}.
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo