jasper report java.sql.date mysql problem

I try to design a report on a mysql database with jaspersoft ireport designer. I have a problem with date typed fields : "unable to get value for field x for class java.sql.date". I have tried to convert the field with the date function in the query but this doesn't help. Thanks by advance for your help.
proximalAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
KalpanConnect With a Mentor Commented:
please check the mysql query are you using for the date fields....please past the query if possible ...

refer the following

http://stackoverflow.com/questions/3615237/jasperreport-field-date
0
 
objectsConnect With a Mentor Commented:
check your not mixing java.sql.Date with java.util.Date
0
 
proximalAuthor Commented:
My field "date_closed" is of the type date in the mysql structure.

This is a very simple query to test the problem :

SELECT
     `opportunities`.`name` AS opportunity_name,
     `opportunities`.`date_closed` AS opportunity_date_closed
FROM
     `opportunities`
ORDER BY opportunity_date_closed

No problem without the ORDER BY clause.
0
 
proximalAuthor Commented:
I reply to myself : there were records with date = null in my table. Everything fine when I solved this problem.

Thanks for your help.
0
 
proximalAuthor Commented:
Solved.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.