Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: rOracle JDBC drivers and setting NLS_DATE_FORMAT in a logon trigger doesn't work

Re: rOracle JDBC drivers and setting NLS_DATE_FORMAT in a logon trigger doesn't work

From: Andre van Winssen \(andrew\) <andrew-no-spam-svp_at_info.nl>
Date: Tue, 19 Mar 2002 11:28:00 +0100
Message-ID: <3c9712c0$0$19572$4d4ebb8e@news.nl.uu.net>


Joe,
>>date are longs

what do you mean ?

The solution is to use Java type java.sql Timestamp in stead of java.lang.String. If you use a java string then datatype conversion must take place and this fails when the NLS_DATE_FORMAT is not the same as the format picture the string contains. So a string "2002-02-02 12:12:12" cannot be converetd to a date if a session's NLS_DATE_FORMAT is "dd-MON-rr".

I'm just curious why the JDBC driver tries to set NLS_DATE_FORMAT since it can be done by the LOGON trigger. The way it's implemented currently
does not allow you to have different nls_date_format's for different java apps
connecting to the same instance since the only workaround is to set nls_date_format
on the instance level (init.ora)

Andre van Winssen

"Joe" <yohan1701_at_nospam.space.com> wrote in message news:MPG.17000cbf7fcc4b439897b4_at_news.bellglobal.com...
> psst did you hear what "Andre van Winssen \(andrew\)" <andrew-no-spam-
> svp_at_info.nl> said
> > yes, this works .. in Oracle. But our javacode attempts to be
> > database independent, so localizations (like NLS) must be as
> > transparant for the application as possible.
> >
> > thanks for the input.
> >
> > Andre
> >
> couldn't you use a PreparedStatement set the date with a parameter. Since
> date are longs your has to driver will do the conversion for you so it
> shouldn't matter what format the date is stored in.
> --
> Joe
>
> "I bent my wookie" - Ralph Wiggum
Received on Tue Mar 19 2002 - 04:28:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US