Jump to content
We've recently updated our Privacy Statement, available here ×

Date format being sent to database


scottmacpherson

Recommended Posts

I am struggling to get a report with has a data input control working through JasperServer.

The problem appears to be that the date entered by the user at runtime is sent to our data source in an incompatible format. The database is Oracle 9.2.8, and the JDBC driver is from the Oracle 10 instant client.

 

The date is selected by the user using the calendar tool, ending up with something like "15-02-2007". However, by monitoring the output to the database, the date is sent as "Thu Feb 15 00:00:00 UTC 2007". This obviously causes an Oracle error.

 

If we run the same jrxml file through iReport, it works perfectly. iReport seems to know how to handle the date correctly.

 

Even more confusing is the fact that this was all working perfectly yesterday, but stopped today. We can't think of anything that could have changed!

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Have attached the full jrxml file for this one. Could it be something to do with the fact that the database field is a timestamp? I still don't understand why iReports works fine though. [file name=AbsencesBySPRBatch1.jrxml size=15579]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/AbsencesBySPRBatch1.jrxml[/file]
Link to comment
Share on other sites

  • 2 months later...

Interesting ... I'm having the same problem. I'm trying to pass date parameters into a MySQL store procedure. The dates are select from Jasper Server calendar widget with the date format dd-mm-yyyy; however, it's passing this date format: 'Fri Jul 30 19:00:00 EST 6' to mysql? What's also strange is it's not even the date I selected from the calendar widget?

 

Please help,

 

Ann [file name=dateFormatError.txt size=2288]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/dateFormatError.txt[/file]

Link to comment
Share on other sites

  • 1 year later...

I was having the same problem with my JasperReports 3.0 pro trial.  I did not experience this with the community version.  However, I was able to fix the issue in the pro version by converting my parameter data type to java.sql.Timestamp (it had been java.util.Date previously). 

Any word on why this will work in the community version and not the pro version?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...