File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem retrieving date type from database.

 
unni krishna
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have come across a peculiar problem when I try to deploy ear in Weblogic Sun Solaris.

I am trying to fetch data from a table which has a field of type DATE.

I am using resultset.getObject(index) method to get the object for each column in the table. The issue starts here. In my windows system when I try to get the type of this object it returns java.sql.TimeStamp for the date column but when I deploy in UNIX it returns to me that object type of this column is java.sql.Date.

Can anyone explain why is this behaving differently in different platforms ?

I am using Weblogic 8.1 SP2 for the deployment in sun and windows OS.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33674
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unni,
It looks like the drivers are giving you different types when you do not specify a specific type to return. If you call the getDate() or getTimestamp() method, you will consistenly get the type you are expecting.
 
unni krishna
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks friend, it worked.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic