Results 1 to 4 of 4
  1. #1
    rchiu5hk is offline Member
    Join Date
    Apr 2011
    Posts
    13
    Rep Power
    0

    Default oracle to_char, to_date --> Java

    Dear all,

    Sorry that I am new to Java.
    I am revamp the application.
    Do you know how to convert below plsql code to be in Java syntax?

    TO_NUMBER((
    TO_DATE(TO_CHAR(:blk_exam_session.END_TIME, 'HH24:MI'), 'HH24:MI')
    - TO_DATE(TO_CHAR(:blk_exam_session.START_TIME, 'HH24:MI'), 'HH24:MI')
    )*24*60)

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: oracle to_char, to_date --> Java

    When converting code you convert the logic, not individual lines.
    That means the above is not something that can be properly translated without knowing the logic it comes from.

    But that line seems to be looking for a duration (in days) from two times and then converting it into minutes?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    rchiu5hk is offline Member
    Join Date
    Apr 2011
    Posts
    13
    Rep Power
    0

    Default Re: oracle to_char, to_date --> Java

    Quote Originally Posted by Tolls View Post
    When converting code you convert the logic, not individual lines.
    That means the above is not something that can be properly translated without knowing the logic it comes from.

    But that line seems to be looking for a duration (in days) from two times and then converting it into minutes?

    Yes, You are right. Could you instruct me?
    diffInMinutes(End_Time - Start_Time)

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: oracle to_char, to_date --> Java

    I don't think you read my comment properly.

    You do not translate code line by line.
    That is not how it works.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Replies: 1
    Last Post: 04-08-2013, 10:22 AM
  2. Oracle VM=Sun VM after oracle bought Sunmicrosystem?
    By jackiewu09 in forum Advanced Java
    Replies: 0
    Last Post: 05-16-2011, 10:28 PM
  3. Java + oracle
    By pavan19406 in forum JDBC
    Replies: 2
    Last Post: 04-04-2011, 10:44 AM
  4. To_date function through Java shows timestamp
    By mpavithra in forum Enterprise JavaBeans (EJB)
    Replies: 2
    Last Post: 07-29-2010, 08:59 AM
  5. Replies: 0
    Last Post: 08-27-2008, 09:27 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
  •