Solved

jasper report java.sql.date mysql problem

Posted on 2011-02-15
5
2,154 Views
Last Modified: 2012-05-11
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.
0
Comment
Question by:proximal
  • 3
5 Comments
 
LVL 14

Accepted Solution

by:
Kalpan earned 250 total points
ID: 34894819
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
 
LVL 92

Assisted Solution

by:objects
objects earned 250 total points
ID: 34894839
check your not mixing java.sql.Date with java.util.Date
0
 

Author Comment

by:proximal
ID: 34895530
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
 

Author Comment

by:proximal
ID: 34895979
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
 

Author Closing Comment

by:proximal
ID: 34898756
Solved.
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
split53 challenge 7 96
allswap challenge 6 98
HSSFWorkbook cannot be resolved error 10 69
javap not working 8 45
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question