%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="java.sql.*"%>
<%
String catNumber=request.getParameter("catNumber");
String VolumeId=request.getParameter("VolumeId");
String pageid=request.getParameter("pageid");
String idnexturl=(" ");
String idprevurl=(" ");
String title="";
String catname="";
String pageidend=pageid.substring(pageid.length()-4);
int pageintnext=Integer.parseInt(pageidend)+1;
int pageintprevious=Integer.parseInt(pageidend)-1;
int charsToPad = 4 - String.valueOf(pageintnext).length();
int charsToPadprev = 4 - String.valueOf(pageintprevious).length();
String idnext = String.valueOf(pageintnext);
for(int i=0; i < charsToPad; i++)
{
idnext = "0".concat(idnext);
}
String idprev = String.valueOf(pageintprevious);
for(int i=0; i < charsToPadprev; i++)
{
idprev = "0".concat(idprev);
}
idnext = pageid.substring(0,(pageid.length()-4)).concat(idnext);
idprev = pageid.substring(0,(pageid.length()-4)).concat(idprev);
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();
ResultSet rs1 = stmt1.executeQuery("SELECT list, catname FROM all_book_list where id='"+VolumeId+"'");
while(rs1.next())
{
title=rs1.getString("list");
catname=rs1.getString("catname");
}
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select identifier from all_info where identifier='"+idnext+"'");
if(rs.next()){
do {idnexturl=("Next Image");
}
while(rs.next());
}
else{idnexturl=("This is the last image");
}
Statement stmt2 = conn.createStatement();
ResultSet rs2 = stmt2.executeQuery("select identifier from all_info where identifier='"+idprev+"'");
if(rs2.next()){
do {idprevurl=("Previous Image");
}
while(rs2.next());
}
else{idprevurl=("This is the first image");
}
}
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) {}
}
}
%>
<% out.println(idprevurl);%> | Information about this image | "> Back to Thumbnails | <% out.println(idnexturl);%> | ||||
|