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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Problems with a stored procedure , Oracle and JDBC

Re: Problems with a stored procedure , Oracle and JDBC

From: Andrea Bruschina <brucext_at_tin.it>
Date: Fri, 01 Jun 2001 17:17:50 GMT
Message-ID: <27QR6.8779$Ww.167389@news2.tin.it>

I have solved the problem...

The Oracle server create a JVM on the Server side uses the the JVM settings for client locale (and ignore the database NLS_NUMERIC_SEPARATOR property)

by setting in the java source BEFORE the connection : import java.util.*
...
Locale.setDefault(Locale.US);
...

so the problem is solved.

Many thans for your help!

Andrea B.

"Sybrand Bakker" <postbus_at_sybrandb.demon.nl> ha scritto nel messaggio news:thd42td9f0juc2_at_beta-news.demon.nl...
>
> "Andrea Bruschina" <brucext_at_tin.it> wrote in message
> news:dDvR6.6394$vt.92765_at_news1.tin.it...
> > Problems with a stored procedure and JDBC
> >
> > I have this problem:
> >
> > I have a stored procedure (written in PL/SQL) that do something like
 this
> > (on a Oracle server 8i):
> >
> > ....
> > First := 5 + 5;
> > Second := 3
> >
> > -- Result is (NUMBER 6,3)
> > Result := First*100/Second;
> >
> > ...
> >
> > q:= DBMS_SQL.EXECUTE('INSERT INTO table(NUMERICVALUE63)' ||
> > VALUES(' || Result || ')';
> > ...
> >
> > ....
> >
> >
> > My problem is:
> >
> > When i call the stored procedure with SQLNavigator or SQL PLUS
> > the command that is executed is:
> >
> > INSERT INTO table(NUMERICVALUE63) VALUES(33.333);
> >
> > and this for me is good...
> >
> > but when i call the stoder procedure via JDBC(thin driver) i obtain
> >
> > INSERT INTO table(NUMERICVALUE63) VALUES(33,333);
> >
> > which give me a too many values error from the DBServer
> > (it uses the comma like separator, not like decimal character)
> >
> > What i have to configure/do to have the right effect?
> >
> > I live in Italy where we write 100% = 100,000% , not 100.000%
> >
> > My client computer is a Windows NT4.
> >
> > Thank to the helpers!
> >
> > Andrea B.
> >
> >
>
> The decimal separator on the *server* either by means of (IIRC)
> NLS_DECIMAL_SEPARATOR or by the internation settings in control panel.
> Usually Oracle picks those latter settings when you don't do anything.
>
> Hth,
>
> Sybrand Bakker, Oracle DBA
>
>
>
Received on Fri Jun 01 2001 - 12:17:50 CDT

Original text of this message

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