Community
Participate
Working Groups
In current JNDI support, if user provide username/password in connection property, after acquire a JNDI DataSource, we will first try to connect using the username/password with API java.sql.DataSource.getConnection(String,String). If the API call failed with either a SQLException or UnsupportedOperationException, we will then try to use API java.sql.DataSource.getConnection() which includes no authentication information. However, for JBOSS' case, the exception thrown is JBOSSResourceException, which is not a subclass of SQLException. We then simply re-throw the exception, which leads to problem. For detailed discussion, please see http://www.birt-exchange.org/org/forum/index.php/topic/22953-jndi-datasource/
Currently while opening JNDI connection, Datasource.getConnection(String, String) with user credential is use to make initial connection attempt; While the initial attempt failed, attempt Datasource.getConnection() without user credential. This is not a problem for design time. In runtime environment, username/password usually differs from design time; Opening a JNDI connection against application server usually does not require using username/passwords. According to the requirement above, the process of getting JNDI connection is changed as below: 1. Attemp obtaining connection by Datasource.getConnection() and catch any exception. 2. If Step#1 failed, try obtaining connection by Datasource.getConnection(String, String) 3. If all above failed, try obtaining connection by JDBC URL.
Fixed
verified on build 3.7.2.v20111107-1411.