%@page import="java.sql.*"%>
Warehouse Extranet
Warehouse Extranet
Welcome to our web site. Here you can obtain product
availability information in real-time.
Note that some products are selling fast so you might want to
order right now if your product of choice is available.
| Manufacturer |
SKU |
In stock |
<%
// registers the JDBC driver
new org.hsqldb.jdbcDriver();
Connection connection =
DriverManager.getConnection("jdbc:hsqldb:db/wholesaler",
"sa",
null);
try {
Statement stmt = connection.createStatement();
try {
ResultSet rs = stmt.executeQuery("select manufacturer, " +
"sku, level from " +
"inventory");
int line = 1;
try {
while(rs.next()) {
String bgcolor = line++ % 2 == 0 ? "#dddddd" :
"#ffffff";
%>
| <%= rs.getString(1) %> |
<%= rs.getString(2) %> |
<%= rs.getInt(3) > 0 ? "true" :
"false" %> |
<%
}
}
finally {
rs.close();
}
}
finally {
stmt.close();
}
}
finally {
connection.close();
}
%>