<%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <%@page import="java.sql.*"%> Kinji Imanishi Archive - Volumes
<% String catNumber=request.getParameter("catNumber"); Connection conn= null; try { Class.forName ("oracle.jdbc.driver.OracleDriver"); String url = "jdbc:oracle:thin:@129.128.199.91:1530:KINJI2"; conn = DriverManager.getConnection(url, "imanishi", "m0nk3y"); Statement stmt1 = conn.createStatement(); Statement stmt = conn.createStatement(); ResultSet rs1 = stmt1.executeQuery("SELECT catname FROM all_book_list where catid='"+catNumber+"'"); ResultSet rs = stmt.executeQuery("SELECT * FROM all_book_list where catid='"+catNumber+"'"); rs1.next(); String catname=rs1.getString("catname"); //Print start of table and column headers out.println("
"); out.println(""); out.println(""); } out.println("

"+catname+"
"); //Loop through results of query. while(rs.next()) { String pageid = rs.getString("id").trim(); String volumeTitle = rs.getString ("list"); out.println("

"); out.println(""+volumeTitle+"
"); } catch(SQLException e) { out.println("SQLException: " + e.getMessage() + "
"); while((e = e.getNextException()) != null) out.println(e.getMessage() + "
"); } catch(ClassNotFoundException e) { out.println("ClassNotFoundException: " + e.getMessage() + "
"); } finally { //Clean up resources, close the connection. if(conn != null) { try { conn.close(); } catch (Exception ignored) {} } } %>

Copyright 2004 Pamela Asquith | Contact | Web design by Natasha Nunn