This page returns the error :
C:\jakarta-tomcat-5.0\work\Standa lone\localhost\ _\tax\tax40sale shistory_jsp.ja va:135:
illegal start of expression
I have narrowed it down to
<% while (rs.next()){
<% } %>
causing the problems. If I remove these two lines, the page loads
fine, but with only one line of data.
I have used the same syntax on a different page, but cannot now get
this page to work. Thanks for any assistance.
Page Code Below:
<% Class.forName(" sun.jdbc.odbc.J dbcOdbcDriver") ; %>
<% java.sql.Connec tion db =
java.sql.Driver Manager.getConn ection("jdbc:od bc:webodbc","us er","pw");
%>
<% java.sql.Statem ent st = db.createStatem ent(); %>
<% java.sql.Result Set rs; %>
<% String stComplete=requ est.getParamete r("address"); %>
<% String stParcel=reques t.getParameter( "parcel"); %>
<% rs=st.executeQu ery("pEQGetPast Sales '" + stParcel + "';"); %>
<% rs.next();
String pn= rs.getString(1) ;
String salesdate= rs.getString(2) ;
String salesprice= rs.getString(3) ;
%>
<html>
<head>
</head>
<body>
<table width=700 align="center" cols="2" border="0">
<tr align=center>
<td><h3>Address : <%= stComplete %></h3></td>
<td><h3>Parce l: <%= stParcel %></h3></td>
</tr>
<tr>
<td colspan=2>
<table cols="2">
<% if (salesprice.equ als("")) { %>
<tr><td colspan="2">No sales.</td></tr>
<% } else { %>
<% while (rs.next()){
<tr><td><%= salesdate %></td>
<td><%= salesprice %></td>
</tr>
<% } %>
<% }; %>
</table>
</td>
</tr>
</table>
</body>
<% rs.close(); %>
<% db.close(); %>
</html>
C:\jakarta-tomcat-5.0\work\Standa lone\localhost\ _\tax\tax40sale shistory_jsp.ja va:135:
illegal start of expression
I have narrowed it down to
<% while (rs.next()){
<% } %>
causing the problems. If I remove these two lines, the page loads
fine, but with only one line of data.
I have used the same syntax on a different page, but cannot now get
this page to work. Thanks for any assistance.
Page Code Below:
<% Class.forName(" sun.jdbc.odbc.J dbcOdbcDriver") ; %>
<% java.sql.Connec tion db =
java.sql.Driver Manager.getConn ection("jdbc:od bc:webodbc","us er","pw");
%>
<% java.sql.Statem ent st = db.createStatem ent(); %>
<% java.sql.Result Set rs; %>
<% String stComplete=requ est.getParamete r("address"); %>
<% String stParcel=reques t.getParameter( "parcel"); %>
<% rs=st.executeQu ery("pEQGetPast Sales '" + stParcel + "';"); %>
<% rs.next();
String pn= rs.getString(1) ;
String salesdate= rs.getString(2) ;
String salesprice= rs.getString(3) ;
%>
<html>
<head>
</head>
<body>
<table width=700 align="center" cols="2" border="0">
<tr align=center>
<td><h3>Address : <%= stComplete %></h3></td>
<td><h3>Parce l: <%= stParcel %></h3></td>
</tr>
<tr>
<td colspan=2>
<table cols="2">
<% if (salesprice.equ als("")) { %>
<tr><td colspan="2">No sales.</td></tr>
<% } else { %>
<% while (rs.next()){
<tr><td><%= salesdate %></td>
<td><%= salesprice %></td>
</tr>
<% } %>
<% }; %>
</table>
</td>
</tr>
</table>
</body>
<% rs.close(); %>
<% db.close(); %>
</html>
Comment