Results 1 to 3 of 3
  1. #1
    mpavithra is offline Member
    Join Date
    Jul 2010
    Posts
    2
    Rep Power
    0

    Exclamation To_date function through Java shows timestamp

    Hi All,

    When i give the select query from toad, SELECT TO_DATE (TO_CHAR (SYSDATE, 'MM/DD/YYYY'), 'MM/DD/YYYY')
    FROM DUAL
    , gives me as the date with proper date format. But when i go through my java program, i am getting with timestamp.

    Actually, my desired output is the date column that i need to show in mm/dd/yyyy format as well as i want it as to_date, so that it will sort by using the date. If, i use the to_char, then it is sorting in character.

    Can some one help in solving this:)

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default

    Can you post the java code that you go thru to show the date?
    The SimpleDateFormat class allows you to format it many different ways

  3. #3
    mpavithra is offline Member
    Join Date
    Jul 2010
    Posts
    2
    Rep Power
    0

    Default

    Actually, i want to achieve through my oracle query. Because through Java I can achieve it. But, is there any way i can achieve through DB side.

Similar Threads

  1. Replies: 3
    Last Post: 07-22-2010, 12:28 PM
  2. how to compare two timestamp
    By baktha.thalapathy in forum New To Java
    Replies: 1
    Last Post: 06-11-2010, 10:05 AM
  3. Send object via web service, with a java.sql.Timestamp attribute
    By diegofsza in forum Enterprise JavaBeans (EJB)
    Replies: 0
    Last Post: 08-15-2009, 11:40 PM
  4. Replies: 2
    Last Post: 12-08-2008, 03:42 PM
  5. Timestamp in SQL format
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-10-2008, 11:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •