Jump to content
Changes to the Jaspersoft community edition download ×

oracle.sql.TIMESTAMP - ClassCastException


avakhrenev

Recommended Posts

Hi!

I have a report that executes well in iReport but it doesn't executes in my application. There are query that returns some fields of oracle.sql.TIMESTAMP type. The textfield that represents it in report have java.sql.Timestamp text field expression class and the expression is "$F{DATETIME}.timestampValue()". It works in iReport 1.3.1 without any problems. But when i try to use this jrxml report in my application i get JRExpressionEvalException caused by ClassCastException:

Code:
java.lang.ClassCastException: oracle.sql.TIMESTAMP
at ClientOperation_1176386895343_505614.evaluate(ClientOperation_1176386895343_505614:383)
at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:186)

Code of ClientOperation_1176386895343_505614.java looks like this:

 

Code:
[code]
...
case 22 :
{
value = (java.sql.Timestamp)(((oracle.sql.TIMESTAMP)field_DATETIME.getValue()).timestampValue());
break;
}
...

How can i solve this problem?

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

Yes, the driver and the database are the same in both cases. I use classes12.jar and Oracle 10G. I have this problem avoided by using TO_CHAR function of oracle (select ... TO_CHAR(CloseDate , 'DD.MM.YYYY HH24:MI:SS') AS CloseDate ...). In this case results are the same. It has solved my problem now, but... something is going on there... :dry:

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...