× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



TAllen@xxxxxxxxxxxx skrev:
I also agree. However, I am restricted to using strings right now. I
cannot use a date object. Also, I do not have access to the driver
properties.

Inserting a date in all different formats (e.g. 11/4/2008, 2008-11-4) works
fine from the SQL green screen. All fail using JDBC. The JDBC insert
seems to want the date in perfect MM/DD/YYYY format with leading zeros, as
is set for the system date format. It seems the only option is to modify
the string to be in MM/DD/YYY format . I don't forsee the system date
format changing but I'd rather not tie myself to it. Is there another way?
I did a quick investigation on the jtopen 6.3 source from SourceForge and it appears that stringToDate(..) in com.ibm.as400.access.SQLDate does the conversion you are having trouble with. You may want to check the source for the version you are using to see the details applying to you, but it appears that substring semantics are chosen based on the value of settings.getDateFormat() and it may take 8 different values (probably derived from the locale information).

I would personally recommend against the "pure string" approach if at all possible, as it will be able to break in numerous ways (it would if run on our development system as we use a different date layout than in the US).

/Thorbjørn

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.