
August 26th, 2003, 11:34 PM
|
|
Contributing User
|
|
Join Date: May 2003
Location: Brisbane, Australia
|
|
|
Wierd problem reading database using java
Hi, I'm having trouble producing a web page in JSP that access an MS SQL Server 8.0 database. I execute the query
sql = "SELECT jobid, name, sum(hours) as hours, firstname, lastname";
sql = sql + " FROM machinehours";
sql = sql + " WHERE processid = " + processid ;
sql += " AND datetime BETWEEN " + safeParseDate(dateFrom) + " AND " + safeParseDate(dateTo);
sql += " GROUP BY jobid, name, firstname, lastname";
to get a result set. \
I'm going through the result set using while (rs.next())
however when i try and access rs.getFloat("hours") something goes horribly wrong. The class stops running and the browser just displays however much html it had received when the error occurred. I've tried running an integrity check on the database and it appears to be ok.
Any ideas as to what the problem could be?
I don't get any error messages or anything, the class just appears to stop and the html is often cut off halfway through a line.
|