29.01.2013 Views

WebSphere Application Server - IBM Redbooks

WebSphere Application Server - IBM Redbooks

WebSphere Application Server - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2. A window will open to allow you to enter or browse to the folder (Web project)<br />

where you want the database design imported. Click Browse and select the<br />

OnLineCatalog project. Click OK and then Finish.<br />

Note: Do you need to reconnect to the database? If you need to<br />

re-establish a connection to the database, select the database in the DB<br />

<strong>Server</strong>s view. Right-click and select Reconnect.<br />

3. The imported information is stored by the wizard in the<br />

Web Content/WEB-INF/databases/SALESAPP directory. If this is the first<br />

time you have worked with a database in the project you will be asked if the<br />

wizard should create the directory. Click Yes.<br />

In this case, the database has been newly created so the import will just add a<br />

folder for the database and a Statements folder underneath. If you had imported<br />

a database with existing tables, views, schema, etc., you would see much more.<br />

Creating a schema<br />

When you imported the database to the Web project, a directory structure was<br />

created under the Web Content/WEB_INF folder to contain the database design<br />

information. You can see this in the Data Definition view by expanding the<br />

OnlineCatalog Web project folder.<br />

Note: If you have installed the sample application and created the database<br />

using the DB2 commands included with the additional material, the tables<br />

have already been created for you and the following steps do not apply. Just<br />

read through them so you will know how we did it.<br />

1. Find the Web Content/WEB_INF/databases/SALESAPP directory, right-click,<br />

and select New -> New schema definition....<br />

Chapter 6. Accessing databases 163

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!