[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[birt-dev] CHECKIN: [131662] JNDI Data Source to get a JDBC pooled connection.
|
Title: CHECKIN: [131662] JNDI Data Source to get a JDBC pooled connection.
Summary:
Added support in the oda.jdbc driver to use a JNDI Name Service to look up a Data Source resource factory to get a pooled JDBC connection.
Bugzilla Entry(ies) Resolved:
131662
Description:
Added support in the oda.jdbc driver to use a JNDI Name Service to look up a Data Source resource factory to get a pooled JDBC connection. The feature is implemented in the existing oda.jdbc driver, instead of a new ODA driver, to facilitate its use at design-time, plus to simplify deployment installation.
A new connection property for the URL of a JNDI Data Source name service is added to the ODA JDBC data source definition. This optional property expects the full URL path, for use by a JNDI initial context to look up a Data Source resource factory. A JNDI URL path is specific to individual JNDI service provider. For example, "java:comp/env/jdbc/<dataSourceName>" for Tomcat.
A text field is also added to the oda.jdbc.ui data source designer pages for user input of the JNDI URL property value.
(To limit the scope of UI changes in BIRT 2.1, driver-specific template for the JNDI URL property value is not supported.)
Some JNDI service providers do not support client-side access.
During design time when using the BIRT report designer, a JDBC data set would need to be designed using direct access to a JDBC driver connection. The JDBC data set query builder continues to use direct JDBC connection to obtain its metadata. Only those oda.jdbc.ui functions directly related to a data source design, such as Test Connection and Preview Results of a data set, are enhanced to first attempt to use a JNDI URL, if specified. And if not successful for any reason, it falls back to use the JDBC driver URL.
Similarly at report runtime, such as during Report Preview, when a non-blank JNDI URL value is specified, the oda.jdbc run-time driver attempts to look up its JNDI name service to get a pooled JDBC connection. If such lookup is not successful for any reason, it falls back to use the JDBC driver URL directly to create a JDBC connection.
To simplify the task of setting up the JNDI initial context environment required by individual JNDI application, the oda.jdbc JNDI feature supports the use of a "jndi.properties" file, installed in the drivers sub-folder of the oda.jdbc plugin.
When deployed within a web application, it looks for the file in the web application's folder tree for the oda.jdbc's drivers sub-folder.
Its use is optional. When such file is not found or problem reading from it, an initial context adopts the default behavior to locate any JNDI resource files, as defined by javax.naming.Context.
Future enhancement may support the use of a driver-specific resource file.
Additional note: when a custom connection factory is associated with a specific JDBC driver class, by implementating the oda.jdbc.driverinfo extension point, it is responsible for the handling of the JNDI look up service, as appropriate. In other words, a custom connection factory defined in a driverinfo extension overrides the default JNDI URL handling.
Tests Description:
Tested w/ Tomcat 5.5.17.
Also ran related Junit tests for regression tests.
Notes to Build Team:
None.
Notes to Developers:
None.
Notes to QA:
None.
Notes to Documentation:
Added text field for the new JNDI URL property in the JDBC data source connection wizard page and property page.
Files Edited:
CVS:/cvsroot/birt/source/
org.eclipse.birt.report.data.oda.jdbc/
plugin.xml
src/org/eclipse/birt/report/data/oda/jdbc/
Connection.java
JDBCDriverManager.java
org.eclipse.birt.report.data.oda.jdbc.ui/
src/org/eclipse/birt/report/data/oda/jdbc/ui/profile/
JDBCSelectionPageHelper.java
src/org/eclipse/birt/report/data/oda/jdbc/ui/util/
Constants.java
DriverLoader.java
Files Added:
org.eclipse.birt.report.data.oda.jdbc/
src/org/eclipse/birt/report/data/oda/jdbc/
JndiDataSource.java
Files Deleted:
None.