background image

Creating a Data Source in the Application

<< Accessing Databases from Web Applications | Java Servlet Technology >>
<< Accessing Databases from Web Applications | Java Servlet Technology >>

Creating a Data Source in the Application

Creating a Data Source in the Application Server
A DataSource object has a set of properties that identify and describe the real world data source
that it represents. These properties include information such as the location of the database
server, the name of the database, the network protocol to use to communicate with the server,
and so on.
Data sources in the Application Server implement connection pooling. To define the Duke's
Bookstore data source, you use the installed Derby connection pool named DerbyPool.
You create the data source using the Application Server Admin Console, following this
procedure:
1. Expand the Resources node.
2. Expand the JDBC node.
3. Select the JDBC Resources node.
4. Click the New... button.
5. Type jdbc/BookDB in the JNDI Name field.
6. Choose DerbyPool for the Pool Name.
7. Click OK.
Further Information about Web Applications
For more information on web applications, see:
The Java Servlet specification:
http://java.sun.com/products/servlet/download.html#specs
The Java Servlet web site:
http://java.sun.com/products/servlet
Further Information about Web Applications
The Java EE 5 Tutorial · September 2007
98