Forum Stats

  • 3,817,327 Users
  • 2,259,314 Discussions
  • 7,893,750 Comments

Discussions

DateTime Problem

713200
713200 Member Posts: 4
edited Sep 18, 2009 4:49AM in General Database Discussions
Hi there,

We are using Oracle 11g, moved(with Export/Import method) our database to x64 Windows Server 2008 , I were using a Java stored procedure like

DateFormat sdfFormatter = new SimpleDateFormat("HH:mm:ss");
Date dtNow = new Date();
Date dtLivre = new Date();
...
dtNow = sdfFormatter.parse(sdfFormatter.format(dtNow));
dtLivre = sdfFormatter.parse(rsTimeTable.getTime("departure_time").toString());
Long lngDif = dtNow.getTime() - dtLivre.getTime();
...
That code piece was working old server(x32 Windows Server 2008) but on new server its giving an error like ' Unparseable date: "16:01:01" ' , I installed JDK 1.6 on new server that code is working well. I checked Regional Settings too , booth server have same settings. I'm gonna crazy. Really this is so important for me ... Thx for help ...

Answers

  • Kamran Agayev A.
    Kamran Agayev A. Member Posts: 5,520 Bronze Crown
    edited Sep 18, 2009 2:10AM
    Gaara wrote:
    Hi there,

    We are using Oracle 11g, moved(with Export/Import method) our database to x64 Windows Server 2008 , I were using a Java stored procedure like

    DateFormat sdfFormatter = new SimpleDateFormat("HH:mm:ss");
    Date dtNow = new Date();
    Date dtLivre = new Date();
    ...
    dtNow = sdfFormatter.parse(sdfFormatter.format(dtNow));
    dtLivre = sdfFormatter.parse(rsTimeTable.getTime("departure_time").toString());
    Long lngDif = dtNow.getTime() - dtLivre.getTime();
    ...
    That code piece was working old server(x32 Windows Server 2008) but on new server its giving an error like ' Unparseable date: "16:01:01" ' , I installed JDK 1.6 on new server that code is working well. I checked Regional Settings too , booth server have same settings. I'm gonna crazy. Really this is so important for me ... Thx for help ...
    Not sure, but may be you should use HH24 instead of HH and change mm to mi. Because mm to mi .. Because mm is MONTH whereas mi is Minute :)
          DateFormat sdfFormatter = new SimpleDateFormat("HH24:mi:ss");
    Edited by: Kamran Agayev A. on Sep 18, 2009 11:09 AM
  • 713200
    713200 Member Posts: 4
    edited Sep 18, 2009 2:55AM
    thx for post but this is not PL/SQL , so there is no pattern like HH24 or mi in Java ...

    I think i have to change Oracle JVM variables but i dunno where can i find that variables ... Confused :S

    Edited by: Gaara on 17.Eyl.2009 23:54
  • 539769
    539769 Member Posts: 900
    Are you getting any ORA-xxxxx errors? We can help you only on ORA- errors. For java help, post the question in some java forum.

    Regards.
  • 713200
    713200 Member Posts: 4
    I'm not getting ORA-xxx errors but this Java code already working in normal jvm it's not working on new servers Oracle jvm. So this is ORACLE JVM problem and i have to ask to Oracle forums. Its look like simple ...
This discussion has been closed.