The building block of J2EE database interaction is the javax.sql package, particularly the javax.sql.DataSource interface. This interface is a relatively simple connection factory. [2] The javax.sql package is basically a J2EE-flavored enhancement of the familiar java.sql package. For those of you not familiar with it, the java.sql package implements methods for basic database interaction. Broadly speaking, this includes the following tasks :
The javax.sql package does all of that, but also provides support for:
It is significant to note that a data source is a network resource accessible through JNDI. In order to implement this network accessibility, you as the application server administrator must bind it to some JNDI logical name . All of the above is background information. From an administration standpoint, data sources are pretty trivial. To create a new data source, open the Services tab, expand the JDBC folder, and click on Data Sources. Click "Configure a new JDBC Data Source" and fill out the values as follows :
Click the Create button when you are done filling out the fields. Next, click the Targets tab and specify the server or cluster on which the data source will reside. |