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 73<br />

Figure 4.10 - Deployed database pool<br />

Note:<br />

You can configure a database pool programmatically using a script by invoking <strong>with</strong>in this<br />

script deploy.bat (on Windows) or deploy.sh (on Linux).<br />

4.2.3 Executing SQL statements to load some data<br />

Using the database pool created in the previous step (which will connect you to the<br />

TESTDB database), create some tables and load them <strong>with</strong> data using SQL statements.<br />

This is also done to test that the database pool is working correctly. The SQL statements to<br />

use are shown in Listing 4.1. Note that the last column of the table is defined as an XML<br />

column.<br />

create table employees(empID INT, empName VARCHAR(20), empDOC XML);<br />

insert into employees(empID, empName, empDOC) values (1, 'Tom',<br />

'<br />

Tom<br />

Clinton<br />

26<br />

');<br />

insert into employees(empID, empName, empDOC) values (2, 'John',<br />

'<br />

John<br />

Park<br />

28<br />

');<br />

insert into employees(empID, empName, empDOC) values (3, 'Jerry',<br />

'<br />

Jerry<br />

Lee<br />

25

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

Saved successfully!

Ooh no, something went wrong!