DayTrader 7 supports two local deployment modes. For quick development and functional testing, the application ships with a pre-built embedded Derby database that requires no external infrastructure — just a JDK and Maven. For production benchmarking and performance testing, DayTrader 7 connects to an external DB2 server via theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/WASdev/sample.daytrader7/llms.txt
Use this file to discover all available pages before exploring further.
server_db2.xml configuration, enabling full load-test workloads with Apache JMeter and realistic database concurrency tuning.
Option 1: Development with Derby
The Derby path is the fastest way to get DayTrader 7 running. The embedded database and a pre-populated dataset are bundled inresources/data, so no separate database setup is needed.
Prerequisites
- JDK 8 or later
- Apache Maven 3 or later
Steps
Build the project
From the root of the cloned repository, run the Maven install goal. This compiles all modules, runs tests, and provisions a local Open Liberty server under
daytrader-ee7/target/liberty/:Start Open Liberty
Change into the
daytrader-ee7 module and launch the server with the liberty:run goal, which starts Liberty in the foreground and tails the logs:Open the application
Once Liberty reports that the server is ready, navigate to:The server also listens for HTTPS traffic on port 9443.
Server configuration (Derby)
The Derby deployment usesserver.xml. Key settings relevant to local development are shown below:
The connection pool is configured with
maxPoolSize=100 and minPoolSize=100. Liberty pre-allocates all 100 connections at startup, so the first request may be slightly slower while the pool warms up.Option 2: Production / Benchmarking with DB2
This setup mirrors the recommended load-testing topology described inREADME_LOAD_TEST.md. It uses server_db2.xml (copied over as server.xml) so Liberty connects to an external DB2 instance over JDBC Type 4.
Prerequisites
- Open Liberty installed and a
defaultServerprofile created at<OPENLIBERTY_HOME> - A running DB2 server with a
TRADEDBdatabase created - DB2 JDBC driver files copied from the DB2 machine:
db2jcc4.jardb2jcc_license_cu.jar
Steps
Install the DB2 server configuration
Replace the default
server.xml with the DB2-specific configuration:Set environment variables
Export the five variables that
server_db2.xml resolves at runtime. Match values to your environment:| Variable | Description |
|---|---|
dbUser | DB2 user name Liberty uses to authenticate |
dbPass | Password for dbUser |
tradeDbHost | Hostname or IP of the DB2 server |
tradeDbPort | DB2 listener port (default 50000) |
tradeDbName | DB2 database name (default TRADEDB) |
Create jvm.options
Create
<OPENLIBERTY_HOME>/usr/servers/defaultServer/jvm.options and set the heap size. The following values are recommended as a starting point for load testing:Create and populate the DB2 database
On the DB2 machine, sign in as the
db2 user and create the trade database:If
DB2_APM_PERFORMANCE is enabled, DB2 will return SQL1803N during database creation. Disable it first:Server configuration (DB2)
server_db2.xml replaces the Derby driver and data-source definitions with DB2 JDBC Type 4 equivalents that resolve credentials and connection details from environment variables:
After the first-time database population completes, stop and restart Liberty before running any load tests. This ensures all connection pool and JMS resources are cleanly initialized against the now-populated schema.