Results 1 to 1 of 1
- 03-08-2009, 01:52 PM #1Member
- Join Date
- Feb 2009
- Rep Power
Persistence problem when changing type to java.sql.Time
Hi. I'm writing a database application for my college course, using tables which were created in Netbeans.
In my database, I have a field (named "DURATION") of type TIME, but the generated code in the table's Class uses java.util.Date. Using this, the table in the swing form will, of course, only display the "zero epoch" value of January 1, 1970.
But I need the app to display a time in the format "00:00:00". In other words, I want to use java.sql.Time instead. Is this the right way to achieve this? Or do I need to parse the date to extract the time from it and display?
I tried changing util.Date to sql.Time: By going through my code and changing the relevant "util.Date" types to "sql.Time", all I got for my trouble was a persistence error:
SEVERE: Application class seatoursdb.SeaTourDBApp failed to launch javax.persistence.PersistenceException: No Persistence provider for EntityManager named seatoursdbPU: Provider named org.hibernate.ejb.HibernatePersistence threw unexpected exception at create EntityManagerFactory: java.lang.NoClassDefFoundError java.lang.NoClassDefFoundError: org/hibernate/proxy/EntityNotFoundDelegate
The NoClassDefFoundError in particular makes me think I've missed something that I'd need to replace to move from Date to Time, but I can't find it in my code.
In all, I'm not sure where to go from here. I've been through the Javadocs for Time and Date and those for the Errors thrown, amongst others, and am still none the wiser. If you've any suggestions (minus "bugger off" :p), or need me to post more information/code to help, I'd greatly appreciate the help. Thanks.