16.10.2015 Views

Getting Started with WebSphere Application Server

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

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

Chapter 4 – Working <strong>with</strong> databases 75<br />

Figure 4.12 - Output of the SELECT statement<br />

4.3 Developing a Web application to access a database<br />

To access a database using a Web application, follow these steps:<br />

1. Create a Dynamic Web Project in Eclipse<br />

2. Create a JSP <strong>with</strong> code to access data, and configure the data source reference<br />

in the Web project configuration files<br />

3. Deploy and run the project on the Community Edition server<br />

4.3.1 Create a Dynamic Web Project<br />

As discussed in Chapter 3, to create a dynamic Web project follow these steps:<br />

1. On Eclipse go to File->New->Dynamic Web Project as shown in Figure 4.13.<br />

Figure 4.13 – New a Web Dynamic Project<br />

2. Input a project name such as chapter4-databases-dbdemo and choose a<br />

project location as shown in Figure 4.14. Ensure IBM WASCE v2.1 is the target<br />

runtime. Then click Finish.

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

Saved successfully!

Ooh no, something went wrong!