Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB, MySQL and TIME Type  RSS feed

 
Georg Joo
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

In my table in MySQL, I have a column with the type "TIME".
In the EJB (cmp field) and VO I defined the field with java.sql.Time.

When I save the time, ist is ok. But when I get the value (in the ejbLoad), I get a SQL Exception. (Cannot convert to type TIMESTAMP !?)

Is the type java.sql.Time ok ?
I have no idea.

Thanks

Georg
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just use a regular java.util.Date. Just because you're mapping your entity beans to a RDBMS doesn't mean you should stick in SQL-specific classes into your beans. (That's the job of the container!! Let it take care of that stuff.)
 
Georg Joo
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I will test ist.

Georg
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!