James,
I dont get a null exception any more, however, I am
getting a strange result. I get the first ten. Then
when I go to the 1/2/3/4 etc it is blank, except for
the links. There is no data, not even rows with null
values. Any ideas would help eliminate my headache ;)
-Dan
Sample Code=======================================
<%@ taglib uri="http://someurl" prefix="pg" %>
<%@ page language="java" import="java.sql.*" %>
<%@ page session= "true" %>
<html>
<header>
<style type="text/css">
A.nodec { text-decoration: none; }
<!--
A:link {text-decoration: none;}
A:visited {text-decoration: none;}
A:hover {text-decoration: underline;}
-->
</style>
</header>
<% //Get the fields passed from Search request page
from form submission
String field = request.getParameter("fieldname");
String field2 = request.getParameter("fieldname2");
String equal = request.getParameter("equals");
String sqlstmts = request.getParameter("sqlstmt");
%>
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection myConn =
DriverManager.getConnection("jdbc:odbc:cpedb");
Statement stmt = myConn.createStatement();
ResultSet myResultSet = stmt.executeQuery("SELECT
"+field+" FROM tbl_cpetest"+
" WHERE " +field2+ "='"
+sqlstmts+ "'");
%>
<%
String requestUri = request.getRequestURI();
int indexOfqm = requestUri.indexOf('?');
if (indexOfqm != -1)
requestUri = requestUri.substring(0, indexOfqm);
String style = request.getParameter("style");
%>
<body bgcolor="#FFFFFF" topmargin="0">
<pg:pager maxIndexPages="<%= 10 %>" maxPageItems="<%=
10 %>">
<pg:param name="style"/> <% /* keep track of style and
variables */ %>
<pg:param name="field"/> <% /* keep track of variables
*/ %>
<pg:param name="field2"/> <% /* keep track of
variables */ %>
<pg:param name="sqlstmts"/> <% /* keep track of
variables */ %>
<table border="0" cellspacing="2" cellpadding="0"
width="46%" align="center">
<tr bgcolor="lightgrey">
<td width="341" height="7" bgcolor="#663300">
<div align="center"><font face="Arial,
Helvetica, sans-serif" size="2">
<b><font color="#FFFFFF">Search
Results</font></b></font> </div>
</tr>
<%
if (myResultSet != null) {
while (myResultSet.next()) {
String a = myResultSet.getString(1);
%>
<pg:item>
<tr bgcolor="lightgrey">
<td width="341" height="8">
<div align="left"><font face="Arial, Helvetica,
sans-serif" size="2"><%= a %>
</font> </div>
</tr>
</pg:item>
<%
}
}
stmt.close();
myConn.close();
%>
</table>
<br>
<br>
<center>
<pg:index>
<pg:prev>
<a href="<%= pageUrl %>">[ (<%= pageNumber %>) <<
Previous ]</a>
</pg:prev>
<pg:pages>
<a href="<%= pageUrl %>"><%= pageNumber %></a>
</pg:pages>
<pg:next>
<a href="<%= pageUrl %>">[ Next >> (<%=
pageNumber %>) ]</a>
</pg:next>
</pg:index>
</pg:pager>
</center>
</body>
</html>
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets