Skip to Content

OpenSQL does not behave right on java.sql.date

Hi there,

when assigning a date with time information to a java.sql.date and then trying to store this by OpenSQL, an exception is thrown like

com.sap.sql.log.OpenSQLException:

Invalid object 5/22/04 19:34 PM

of type java.sql.Date assigned to host variable [...]

This seems to be a bug in OpenSQL, which does not normalize the date to a date without time information.

With JDK 1.1.x, the normalization has been done within the JDK; now, the driver is responsible for doing this; there was a time when this was already implemented, but the doc's have been old, but now, they speak clearly:

"If the given milliseconds value contains time information, **the driver** will set the time components to the time in the default time zone (the time zone of the Java virtual machine running the application) that corresponds to zero GMT."

Please, could someone care about this?!

Thanks in advance,

Detlev

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on May 30, 2004 at 02:33 PM

    Hi,

    as OpenSQL is an implementation of SQL, it's not supposed to support any kind of data type. Please watch the manuals for OpenSQL and come back with an OSS erros message in case you find the clear statement that it should work. Concerning data types you should find explicit information in the manuals.

    Regards,

    Benny

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 23, 2005 at 02:51 PM

    Hi,

    Can someOne give met a sample to work arround this sql error or Note number. I want to save the current Date and time in sql database.

    Richard

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Richard,

      funny enough that you seem to be the first person having stumbled over this 1.5 years after I have... That time, I have opened an OSS message additively, and in short the result was: It's not a bug, it's a feature :-| At least, most of the reasoning I couldn't follow, but who cares (most of the arguments obviously have been wrong)... :-|

      Anyhow, this is the interesting part of the answer, as long as SAP is the only(? at least: only known) driver implementor violating the specification:

      > To help the application with the task to normalize a

      > Date (and Time) object, we offer the helper class

      > com.sap.sql.DateTimeNormalizer which you find in

      > opensql.jar.

      Hope it helps

      Detlev

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.