Hi all,
I'm sort of new to this, so bear with me ...
I've got a
servlet which I want to open a DB2 database and read in the records. The DB2 database resides on an AS400 mid-range computer.
Right now the servlet is just reading in the data from another class (MyCatalog)where the data was hard-coded in, shown below:
public abstract class MyCatalogPage extends HttpServlet {
private MyItem[] items;
private
String[] itemIDs;
private String title;
/** Given an array of item IDs, look them up in the
* Catalog and put their corresponding Item entry
* into the items array. The Item contains a short
* description, a long description, and a price,
* using the item ID as the unique key.
* <P>
* Servlets that extend CatalogPage <B>must</B> call
* this method (usually from init) before the servlet
* is accessed.
*/
protected void setItems(String[] itemIDs) {
this.itemIDs = itemIDs;
items = new MyItem[itemIDs.length];
for(int i=0; i<items.length; i++) {
>>>>>>> items[i] = MyCatalog.getItem(itemIDs[i]); <<<<<<<<
}
}
My question is: 1) How do I read these in from the DB2 database??
(I'm a little famaliar with ODBC and
JDBC)
Thanks....