I have created an EJB corresponding to one of the audit tables and the problem I am having is that when using the getter methods of the bean to get the values of the tables columns I get null pointer exceptions because some of the columns have null values. Is there a way to handle this. Also the other problem I have is that we have a column in the table with Oracle data type Date, format: mm/dd/yy hh:mm:ss, which on coversion to the java.sql.Date type returns only the Date part of the database value. Is there a way to extract the complete data format value?.
Your help would be sincerely appreciated.
Thanks
Gautam
-
SQL & Java Mapping using EJB's (2 messages)
- Posted by: Gautam A
- Posted on: January 22 2006 17:12 EST
Threaded Messages (2)
- SQL & Java Mapping using EJB's by ravi rasappan on January 24 2006 09:30 EST
- More details... by ravi rasappan on January 24 2006 09:39 EST
-
SQL & Java Mapping using EJB's[ Go to top ]
- Posted by: ravi rasappan
- Posted on: January 24 2006 09:30 EST
- in response to Gautam A
Hi,
USe java.sql.Timestamp.getTime() to get the date and time.
Let me know if you need more detail.
Ravi -
More details...[ Go to top ]
- Posted by: ravi rasappan
- Posted on: January 24 2006 09:39 EST
- in response to ravi rasappan
Use this,
java.sql.Timestamp timestamp = resultSet.getTimeStamp(Field);
java.util.Date date = timestamp.getTime();
//date will have the date and time....
I hope this will help you. let me know if you need more details...