JDBC Datasources Work in the Business Components Browser in 11g

In JDeveloper / ADF releases prior to 11g, developers tended to use one an application module configuration for running in the Business Components tester (or JUnit tests) and another for running their web application. The web configuration would typically reference a JDBC datasource, since it simplifies maintenance of the connection credentials by allowing them to be centrally managed in the Java EE container. The second configuration for use by the tester and JUnit, which referenced a more traditional JDBC URL connection string, was necessary since the JDBC datasources did not work outside of the Java EE container.

In the 11g release we've enhanced ADF to allow datasources to be used both inside and outside the Java EE container, so there should be no reason stopping you from using a single configuration based on a JDBC Datasource for all your needs. The Edit Business Components Configuration dialog even helps you pick the correct JDBC Datasource syntax with a convenient dropdown list, based on the set of application resources connections you've defined in your workspace. For example, for a connection named 'scott', the JDBC Datasource name would be 'java:comp/env/jdbc/scottDS'

JDeveloper automatically generates the Weblogic JDBC datasource module for you when you deploy your application if you have checked the 'Auto-generate and Synchronize weblogic-jdbc.xml Descriptors During Deployment' checkbox on the Deployment page of the workspace's Application Properties dialog. Choose {Application | Application Properties...} from the main menu in JDeveloper 11g R1 to see this option.

If you do decide to continue using JDBC URL connections, rather than datasources, make sure to uncheck this application deployment option to avoid creating an unnecessary datasource in the application server that your application won't end up using.
Comments:

Post a Comment:
Comments are closed for this entry.
About
Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today