Java Reference
In-Depth Information
L ISTING 22.9
Continued
// if there is, then set the price
// to the bid price
// and reset the ask to 0
update.append(“ SET PRICE = “ + price);
update.append(“, BID = 0”);
update.append(“ WHERE SYMBOL = '“ + symbol + “'“);
}
else {
// if there is no match set the ask
// price to the offered price
update.append(“ SET ASK = “ + price);
update.append(“ WHERE SYMBOL = '“ + symbol + “'“);
}
statement.executeUpdate(update.toString());
}
}
}
finally {
pool.releaseConnection(con);
}
}
}
Using the Trader Application
In this section you are will use the Trader Web application. Make sure you have completed the
following steps:
1.
Create the Trader Web application.
2.
Set up the TraderConnectionPool as described in the previous sections, including mak-
ing sure the ConnectionPool package is in your classpath.
3.
Move all JSPs to the <SERVER_ROOT>/webapps/trader/ directory.
4.
Make sure that the Service and Controller classes are in you classpath.
5.
Compile all of the service implementations and move the class files to the
<SERVER_ROOT>/webapps/trader/WEB-INF/classes/ directory.
After you have started the Tomcat server, open your browser to the following URL:
http://localhost/trader/index.jsp
You should see the Trader home page (refer to Figure 22.4).
Search WWH ::




Custom Search