Arrays in JSP
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Shirley_Ho
Posted On:   Wednesday, December 11, 2002 08:10 PM

I would like to store the records from the database into an array in JSP. I have declared the array. <%! String event[] = new array[32]; %> I call the sql statement from the database to extract the record. and I started a while loop through the database and placing the records into the array using the dates as the index. <% while(rsEvent.next()) { event[rsEvent.getInt("Dt_Event")] = rsEvent.getString("Event"); } %> when I run it I face this error:- Type expected. while(rsEvent.next()) { ^ can someone pls tell me what is going on and whethe   More>>

I would like to store the records from the database into an array in JSP. I have declared the array.


<%! String event[] = new array[32]; %>



I call the sql statement from the database to extract the record.


and I started a while loop through the database and placing the records into the array using the dates as the index.


<% while(rsEvent.next()) {


event[rsEvent.getInt("Dt_Event")] = rsEvent.getString("Event");


} %>



when I run it I face this error:-


Type expected.

while(rsEvent.next()) {

^


can someone pls tell me what is going on and whether what i wrote is correct?

   <<Less

Re: Arrays in JSP

Posted By:   Lasse_Koskela  
Posted On:   Wednesday, December 11, 2002 10:53 PM

The error is probably due to some syntax error on a n earlier line on the JSP. You should post the whole JSP code up to the while-loop.
About | Sitemap | Contact