29.01.2013 Views

WebSphere Application Server - IBM Redbooks

WebSphere Application Server - IBM Redbooks

WebSphere Application Server - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Java package: During the wizard you will have a chance to create a front<br />

controller for the Web pages. The front controller is a servlet and therefore will<br />

be compiled into a class. The Java package determines where the class is<br />

stored. If you leave this blank, default package is used.<br />

SQL Statement Type: The SQL statement type determines the type of SQL<br />

statements that will be created.<br />

The choices are:<br />

– Select statement<br />

– Update statement<br />

– Insert statement<br />

– Delete statement<br />

In this case since we are querying the database, we choose Select<br />

statement.<br />

Model: The model options determine the type of pages that will be created.<br />

The options you can choose from depend on the SQL statement type you<br />

selected. You can see a description of the option you have selected in the<br />

Description area below the model field.<br />

Since we have specified Select Statement as our SQL statement type, we<br />

have the following model options:<br />

– <strong>IBM</strong> Database Access Tag Lib - Select Statement<br />

Using this choice, a select is done against the database for information,<br />

which is then displayed in table format to the user. There is no need to<br />

allow the user to select an item for further details. Database access is<br />

handled using the JSPSQL tag library.<br />

– <strong>IBM</strong> Database Access Tag Lib - Master Details Pattern<br />

This is similar to the previous pattern, except the database information is<br />

displayed in two-tiers. The first database select retrieves high-level<br />

information and displays the records in a table format. The user can then<br />

select an entry to get further details. This pattern also accesses the<br />

database using the JSPSQL tag library.<br />

– <strong>IBM</strong> Database Access JavaBeans - Master Details Pattern<br />

This is similar to the tag library master details pattern with the exception<br />

that it uses JavaBeans instead of tag libraries to access the database.<br />

While the tag library patterns fit more into the Model 1 category of design,<br />

the JavaBeans pattern is more of a Model 2 type of design. This gives the<br />

flexibility of manipulating the data before it is displayed in the JSP.<br />

In our example we select <strong>IBM</strong> Database Access Tag Lib - Master Details<br />

Pattern.<br />

176 <strong>IBM</strong> <strong>WebSphere</strong> <strong>Application</strong> <strong>Server</strong> - Express V5.0.2 Developer Handbook

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

Saved successfully!

Ooh no, something went wrong!