Data Sources

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 :

[2] A connection factory is a mechanism for creating instances of a class without having to explicitly instantiate an implementation class.

  • Database driver management

  • Connection handling

  • Statement execution

  • Result-set manipulation

The javax.sql package does all of that, but also provides support for:

  • JNDI lookups of database names

  • Connection pooling

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 :

Name

The name of this data source. This can be anything you like, so long as it is unique to the server or cluster on which it resides.

JNDI Name

Here you define the JNDI name of this data source, as it will be accessed by the clients .

Pool Name

If you are associating the data source with a connection pool, this is where you specify the pool name. (See the discussion of connection pools, above.)

Row Prefetch Enabled

Checking this option improves overall performance in situations (like Internet access) where the data source is being accessed by clients not running on the local machine. It tells WebLogic to send the client some number of rows automatically, rather than waiting for individual rows to be requested .

Row Prefetch Size

When Row Prefetch Enabled is checked, this option specifies how many rows will be automatically sent to the client.

Stream Chunk Size

The data in a Prefetched result set will be sent to the client in chunks of this size.

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.



BEA WebLogic Server Administration Kit
BEA WebLogic Server Administration Kit (Prentice Hall PTR Advanced Web Development)
ISBN: 0130463868
EAN: 2147483647
Year: 2002
Pages: 134
Authors: Scott Hawkins

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net