Results 1 to 1 of 1
- 10-09-2009, 10:38 AM #1
Member
- Join Date
- Oct 2009
- Posts
- 4
- Rep Power
- 0
Oracle & JSTL - Data not being retrieved correctly?
First off...apologies from a newb if I'm posting this in the wrong area...please tell me where to go (politely) and I'll post there :D
I have a JSP page which is using JSTL tags to retrieve data from an Oracle database and it's giving me some weird formatting issues which I can't seem to get resolved. I've been following most of the examples on how to format data in a table, but for some reason all my columns/data are not being displayed correctly.
My query looks like this:
The actual presentation section looks like this:Java Code:<sql:query var="idata"> SELECT batch_date "Batch Date" ,produced_vol "MPRS Produced" ,processed_vol "MPRS Processed" ,online_vol "MPRS Online" ,TO_CHAR(ecoes_date,'DD-MON-YYYY HH24:MI:SS') "ECOES Complete" FROM mprs_instr_counts WHERE batch_date >= SYSDATE -7 AND mpid = 'SPOW' ORDER BY batch_date DESC </sql:query>
The output appears like this:Java Code:<table> <%-- Get the column names for the header of the table --%> <c:forEach var="columnName" items="${idata.columnNames}"> <th><c:out value="${columnName}"/></th> </c:forEach> <%-- Get the value of each column while iterating over rows --%> <c:forEach var="row" items="${idata.rows}"> <tr> <c:forEach var="column" items="${row}"> <td><c:out value="${column.value}"/></td> </c:forEach> </tr> </c:forEach> </table>
As you may be able to see, the code is recognising that there are 5 columns worth of data to output, but it's getting the data mixed up with the headers, and missing headers and some data out alltogether.Java Code:<blank column header> Batch Date MPRS Produced <blank> <blank> 07-OCT-2009 19:50:36 30598 16171 <no data> <no data> 06-OCT-2009 22:55:31 44359 27871 06-OCT-2009 00:28:07 75433 53256 02-OCT-2009 22:23:47 45129 29073
The first column should be called BATCH_DATE, and as can be seen, the date *is* in the first column, but the actual header is blank and then the BATCH_DATE header appears in the *second* column with the wrong data!
It's driving me nuts...any suggestions anyone would be very much appreciated!
Cheers,
Kev.
Similar Threads
-
Oracle/JSTL - All data not being retrieved/displayed
By kev_thomas in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 10-09-2009, 11:26 AM -
how to display data from oracle database?
By deru4jesus in forum JavaServer Faces (JSF)Replies: 0Last Post: 04-16-2009, 08:46 AM -
why oracle index can't work correctly in oracle?
By wwwlife in forum JDBCReplies: 0Last Post: 08-27-2008, 09:27 AM -
Problem is getting the data to browser(JSTL)
By freddieMaize in forum JavaServer Pages (JSP) and JSTLReplies: 6Last Post: 07-15-2008, 03:04 PM -
Hibernate 2.1.8 / Oracle 10 / Tomcat 5.0.28 : Data not retrieved from the database
By scastro in forum JDBCReplies: 4Last Post: 08-09-2007, 10:41 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks