Java function with oracle parameters

Hi all,
Does someone knows why i have an error using the java function setDouble with the NLS_TERRITORY = FRANCE and not with NLS_TERRITORY = AMERICA ?
what have i do to correct it ?
Thanks in advance

What is the output of the following, both when
NLS_TERRITORY = FRANCE and with NLS_TERRITORY = AMERICA ?
SQL> select to_number('123.45') from dual ;
TO_NUMBER('123.45')
             123.45
1 row selected.
SQL> select to_number('123,45') from dual ;
select to_number('123,45') from dual
ERROR at line 1:
ORA-01722: invalid number
SQL>

Similar Messages

  • Java functions with Oracle 10g

    I have browsed through other related message threads on this forum and it seems that the general recommendation is to develop stored procedures and functions using PL/SQL.
    I need to implement a set of functions that perform date related processing and are self contained (no SQL code or calls). For this I could reuse some Java methods that I have successfully used in an Apache Derby database. In this situation what is your experience related to performance of Java functions compared to PL/SQL? Does the effort of rewriting this code in PL/SQL make sense?

    I made some changes on the class posted by to solve the encoding problems with CLOBs.
    So here is the result of my job.
    import java.sql.SQLException;
    import oracle.sql.*;
    import java.io.*;
    import java.util.zip.InflaterInputStream;
    import java.util.zip.DeflaterOutputStream;
    * A simple class for LOB compression and decompression in Oracle Database.
    * Will work in 8i and better.  Use utl_compress from 10g onward.
    public class CompressionUtility {
         private static void pipeStreams( InputStream inStream, OutputStream outStream, int bufferSize) throws IOException {
              //System.out.println("PIPE -");
              byte[] buffer=new byte[bufferSize];
              int cnt;
              while ((cnt=inStream.read(buffer))!=-1) {
                   outStream.write(buffer,0,cnt);
         private static void pipeStreams( Reader inStream, Writer outStream) throws IOException {
              //System.out.println("PIPE Reader-Writer");
              int val = 0;
              while ( (val = inStream.read()) != -1 ) {
                   outStream.write(val);
         private static void pipeStreams( Reader inStream, OutputStream outStream) throws IOException {
              //System.out.println("PIPE Reader-");
              int val = 0;
              while ( (val = inStream.read()) != -1 ) {
                   outStream.write(val);
        private static void pipeStreams( InputStream inStream, Writer outStream) throws IOException {
              System.out.println("PIPE -Writer");
              int val = 0;
              while ( (val=inStream.read()) != -1 ) {
                   outStream.write(val);
    * Compresses the CLOB into BLOB
    * @param clob the source CLOB (plain text)
    * @param blob the target BLOB (will hold compressed binary data) it should be
    * an empty BLOB retrieved for example with dbms_lob.createtemporary(l_blob,true);
    * @throws Exception mostly I/O exception if ever
         public static void compress(CLOB clob, BLOB blob) throws IOException, SQLException {
              //System.out.println("Compressione C->B");
              Reader in=clob.getCharacterStream();
              Writer z=new OutputStreamWriter(new DeflaterOutputStream(blob.getBinaryOutputStream()));
              DeflaterOutputStream z = new DeflaterOutputStream(blob.getBinaryOutputStream());
              int val = 0;
              while ( (val=in.read()) != -1 ) {
                   z.write(val);
              pipeStreams(in, z);
              in.close();
              z.close();
    * Decompresses the BLOB into CLOB
    * @param blob the source BLOB (compressed binary data)
    * @param clob the target CLOB (will hold plain text) it should be an empty CLOB
    * retrieved for example with dbms_lob.createtemporary(l_clob,true);
    * @throws Exception mostly I/O exception if ever
        public static void decompress(BLOB blob, CLOB clob)
          throws IOException, SQLException {
               //System.out.println("Decompressione B->C");
            Writer out=clob.getCharacterOutputStream();
            Reader z=new InputStreamReader(new InflaterInputStream(blob.getBinaryStream()));
              InflaterInputStream z = new InflaterInputStream(blob.getBinaryStream());
            int val = 0;
              while ( (val=z.read()) != -1 ) {
                   out.write(val);
            pipeStreams(z, out);
            z.close();
            out.close();
    * Compresses the BLOB into BLOB
    * @param slob the source BLOB (plain binary data)
    * @param blob the target BLOB (will hold compressed binary data) it should be
    * an empty BLOB retrieved for example with dbms_lob.createtemporary(l_blob,true);
    * @throws Exception mostly I/O exception if ever
        public static void compress(BLOB slob, BLOB blob)
          throws IOException, SQLException {
               //System.out.println("Compressione B->B");
            InputStream in=slob.getBinaryStream();
            DeflaterOutputStream z=new DeflaterOutputStream(blob.getBinaryOutputStream());
            pipeStreams(in, z, blob.getBufferSize());
            in.close();
            z.close();
    * Decompresses the BLOB into CLOB
    * @param blob the source BLOB (compressed binary data)
    * @param slob the target CLOB (will hold plain binary data) it should be an
    * empty CLOB retrieved for example with dbms_lob.createtemporary(l_blob,true);
    * @throws Exception mostly I/O exception if ever
        public static void decompress(BLOB blob, BLOB slob)
          throws IOException, SQLException {
               //System.out.println("Decompressione B->B");
            OutputStream out=slob.getBinaryOutputStream();
            InflaterInputStream z=new InflaterInputStream(blob.getBinaryStream());
            pipeStreams(z, out, blob.getBufferSize());
            z.close();
            out.close();
    }The main problem was with the getAsciiStream() function that has to be replaced by getCharacterStream().

  • Using Java Dictionary With Oracle

    Can Someone tell how can i configure my java dictionary with oracle...Currently if a create a table from my IDE and then deploy it it  deploys to the Default SAP DB ...how do  i directrly create  tables in oracle by just  specifying the Deploy option ...
    And further  on  I want my web Dynpro application to talk with oracle db..how do i acheive this..
    Please Help!!

    Hi, 
             Does this mean that the additional features of The Java Dictionary (bufferring etc ) can only be implemented if we ONLY connect to the SAP DB---- YES
    If I have to utilize the services of Java Dictionary in my application i can only use The SAP DB database -- YES
    You deploy a dictionary project to create a table in the DB.
    When it is a DB created and used by Web AS ,it is possible to create tables in that DB with dictionary project using the standard connection parameters specified in visual admin.
    Java Dictionary purpose is to create a DB abstraction by providing a standard interface to create tables whatever the DB used by WebAS maybe.
    Regards
    Bharathwaj
    Edited by: Bharathwaj R - Hope this makes it clear !

  • Question about function with in parameters

    Hello,
    I have a question about functions with in-parameters. In the HR schema, I need to get the minimum salary of the job_id that is mentioned as an in-parameter.
    this is what I am thinking but I dont know if it's correct or not or what should I do next!
    create or replace function get_minimum_salary (i_job_id in varchar2)
    return number
    as
    begin
    SELECT min_salary INTO min_sal
    FROM jobs
    where job_id = get_minimum_salary(xy);
    RETURN i_job_id;
    end get_minimum_salary;
    thanks in advance
    EDIT
    Thanks for your help all.
    Is it possible to add that if the i_job_id which is the in type parameter does not have a minimum salary then use the following function to register an error:
    create or replace procedure insert_error (i_error_code in number,
                                                      i_error_message in varchar2)
    as
    begin
    insert into error_table (error_user, error_date, error_code, error_message)
    values (user,sysdate,i_error_code,i_error_message);
    end insert_error;
    This function is basically to say that an error has occured and to register that error, at the same time I need to print out the error using the dbms_out.put_line.
    Any ideas of how to do that?
    Thanks again
    Edited by: Latvian83 on Jun 1, 2011 5:14 AM

    HI
    I have made little bit changes in ur code. try this
    create or replace function get_minimum_salary (i_job_id in varchar2)
    return number
    as
    v_Min_sal jobs.salary%type=0;---- Variable declaration
    begin
    SELECT min_salary INTO v_ min_sal
    FROM jobs
    where job_id = i_job_id;
    RETURN v_Min_sal;
    end get_minimum_salary;
    Regards
    Srikkanth.M

  • Function with incomplete parameters

    I create a function with many parameters
    and I call this function through my application
    but when I call function I must declare all parameter inside this function like
    ddd("a","b",0,0,0,0,0,0,0)
    is there a method let function set a default value for parameter if code didn't declare it

    You can send just few first parameters and the rest will be passed as false. If you need to pass, say, first and 7th parameter, then you put 6 commas between values, as there is no named parameters in VFP and all parameters are passed by position.
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • Pls give me example of Java Servlet with Oracle

    Hi Guys,
    I am new to Database connectivity of JAVA Servlet with Oracle.
    So can you give me one complete example of connecting Java Servlet with Oracle 9i database.
    [ i mean Select statement, Insert statement..]
    I have tomcat server which comes built-in with NetBeans IDE.
    I need this because, i always come accross messages saying that " you need to change classpath this way " , or " you need to write connection this way "....
    So to avoid all this wrong things..i need your help.
    You guys can reply me on [email protected]
    Thanks & Appreciate..
    Dal Hit

    I got succeeded!
    I changed the three point:
    * add 'package hoo;' in HelloBean.java
    * add '<%@ page import="my.HelloBean" %>' in hello3.jsp
    * change '<jsp:useBean id="hello" class="HelloBean">
    to '<jsp:useBean id="hello" class="my.HelloBean">
    Before posting, I searched google three times but couldn't get answer.
    I could not get well if you didn't give me help...
    Thank you very much.

  • How to call java function with parameter from javascript in adf mobile?

    how to call java function with parameter from javascript in adf mobile?

    The ADF Mobile Container Utilities API may be used from JavaScript or Java.
    Application Container APIs - 11g Release 2 (11.1.2.4.0)

  • How to call java function in Oracle forms?

    Hi I am having Oracle 9i with 10g Developer Suite.
    I am new to Oracle forms..
    I had one function in java getDatas()..
    How can I call this function in Oracle Forms..
    Pls help
    Thanks

    Thanks Francois,
    I want to display values from my java code in the Forms..
    For that purpose only i am installing 10g Developer Suite..
    The below is java code..
    public class DBTest {
              public static String callDB(int id,String name){
              String ss="Hai";
              Connection con=null;
              try{
                   Class.forName("oracle.jdbc.driver.OracleDriver");
                   con = DriverManager.getConnection("url","id","pwd");
                   Statement st=con.createStatement();
                   System.out.println("Connected...");
              int r=st.executeUpdate("Insert into FORM_TEST VALUES('"+id+"','"+name+"')");
                   if(r==1){
                        ss="Inserted Sucessfully";
                   else{
                        ss="Insertion Failed";
              }catch(final Exception e){
              System.out.println(e);
              return ss;
         public static void main(String[] args) {
              int empid=102;
              String empname="Gilbert";
              String resultStr=callDB(empid,empname);
              System.out.println(resultStr);
    I want to dispaly Inserted or Insertion Failed in Oracle Forms..
    As per Gerd Volberg suggestion, i had placed DBTest.jar in
    E:\DevSuite\forms\java\DBTest.jar
    and in formsweb.cfg the below jar is added..
    archive_jini=frmall_jinit.jar,DBTest.jar
    But in Fomrs Builder-->Program-->Import Java Classes-->Oracle
    org,ice,com and subnodes are available.
    But my jar is not available..
    Is my way is coorect?
    Pls provide soln..
    Thanks

  • Xdk: calling java function with a CharSequence parameter

    When using xdk version 10.1.0.2.0_production, you can not call a javamethod with a CharSequence parameter.
    Sun documentation:
    Interface CharSequence
    All Known Implementing Classes:
    CharBuffer, String, StringBuffer
    This prevents us from calling a method like
    java.util.regex.Pattern.matches(String, CharSequence)
    Converting the parameter to a normal string would solve the problem.
    Example to illustrate the issue:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdt="http://www.w3.org/2005/02/xpath-datatypes" xmlns:Pattern="http://www.oracle.com/XSL/Transform/java/java.util.regex.Pattern">
         <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="/">
    <xsl:if test="Pattern:matches('...','123')">
    <xsl:text>MATCH</xsl:text>
    </xsl:if>
    </xsl:template>
    </xsl:stylesheet>
    results in the following stacktrace:
    oracle.xml.parser.v2.XPathException: Extension function error: Error invoking 'matches':'java.lang.NullPointerException'
         at oracle.xml.parser.v2.XSLExtFunctions.callStaticMethod(XSLExtFunctions.java:113)
         at oracle.xml.parser.v2.XPathExtFunction.evaluateMethod(XPathExtFunction.java:296)
         at oracle.xml.parser.v2.XPathExtFunction.evaluate(XPathExtFunction.java:223)
         at oracle.xml.parser.v2.XSLCondition.testCondition(XSLCondition.java:185)
         at oracle.xml.parser.v2.XSLCondition.processAction(XSLCondition.java:165)
         at oracle.xml.parser.v2.XSLNode.processChildren(XSLNode.java:403)
         at oracle.xml.parser.v2.XSLTemplate.processAction(XSLTemplate.java:191)
         at oracle.xml.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:507)
         at oracle.xml.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:484)
         at oracle.xml.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:256)
         at oracle.xml.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:146)
         at oracle.xml.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:218)
         at XSLSample.main(XSLSample.java:75)
    Message was edited by:
    user449717

    Hi Grarup,
    I took a stab at getting this to run and compile and this is what I came up with.  Let me know if this helps at all.
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    namespace ConsoleApplication1
    class Program
    static void Main(string[] args)
    Console.WriteLine("\"True\" or \"False\"?");
    bool boolVal = bool.Parse(Console.ReadLine());
    Functions f = new Functions();
    TestStruct t = new TestStruct() { Value = boolVal };
    f.Flip(ref t);
    Console.WriteLine(string.Format("Flipped value = {0}: ", t.Value));
    Console.ReadLine();
    public struct TestStruct
    public bool Value;
    public class Functions
    public void Flip(ref TestStruct testStruct)
    testStruct.Value = !testStruct.Value;
    Best of luck.

  • Advice please: how to link java client with oracle AS

    Dear Sirs...
    how can i link java swing application with oracle application server? do i have to develop web service and then deploy it on the AS? or i should use another methodology? what exactly should i provide or should i use?
    thanks for any help
    best regards

    There are a number of approaches you can take. A webservice would work well. You may also consider using EJBs and calling them via RMI or a webservice.
    Either is a viable option depending on your requirements.

  • How to integrate Java SSO with Oracle Weblogic

    Hi,
    I am new to Oracle weblogic, but i want to do something like below.
    I want to use Oracle weblogic as application server and want to integrate Java SSO into it. I think we can do it using Oracle access manager but since OAM itself is massive drop this plan.
    I think we can use OC4j Java SSO into Oracle weblogic, but don't knw whether it is feasible.
    Can somebody please guide me solve this problem.
    Any suggestion or comment is most appreciated.

    weblogic docs (and there identity asserters) - http://one-size-doesnt-fit-all.blogspot.com/2008/12/configuring-wls-with-ms-active.html

  • Java appl. with oracle on Linux

    Hello all,
    I would like to ask how to connect my Java application to
    Oracle on Linux. Is there any JDBC driver ?
    null

    Hi Mark,
    I am also running Oracle 8.0.5 in my RD6.0 machine.
    I installed Developer2000 into my win98 machine.
    I tried to login using the developer2000 into the
    oracle running under linux but connection cannot
    go through. I don't know the reason to this. Though
    I can use the SQL*Plus to connect to this database
    from win98, can you figure out what is wrong with
    my setup?
    Thanks,
    -Paul
    Mark Kirkwood (guest) wrote:
    : Hi all,
    : I thought you guys might be interested to know that this stuff
    : is used out there...
    : I work for a Government property management company ( Housing
    : New Zealand ), and they were looking at downsizing their
    systems
    : infrastructure. A subset of the business was picked to pilot a
    : downsized system.
    : We ported from :
    : "thin client" : Citrix Winframe, Developer 2000, HPUX , Oracle
    : 7.3
    : to a :
    : client server : Win95, Developer 2000, RedHat 6.0, Oracle
    8.0.5SE
    : Instead of running 80 users on :
    : 80 P300 PCs, Winframe Client +
    : 1 4xP200 Winframe/NT, Developer 2000 +
    : 1 HP-PA/Risc, HPUX ,Oracle 7.3.3
    : We are running 5 users on :
    : 5 P300 PC Win95, Developer 2000 +
    : 1 P300 PC RedHat 6.0, Oracle 8.0.5, samba
    : ( Obviously this was the pilot subset ! )
    : Although this represents a "step backwards" in deployment
    : architecture ( 3 tier - 2 tier ), it represented a decrease in
    : cost infrastructure per user ( No Winframe/NT License, No
    : expensive Proprietry hardware, only 1 ( Cheap ) propritary o/s
    : Win95 ).
    : We went live with this beast on 1 Aug.
    : The Redhat box has been rebooted once since them - not by us (
    : Power outage at the site ).
    : The server is just idling with 5 concurrent connections.
    : Oracle 8.0.5/Redhat is rock solid as far as we can tell !
    : ( with the right patches ....
    : for those interested they are
    : 8.0.5.1 patchset
    : redo log async write - bug 882446
    : glibc patch
    : setuid security patch
    : Cheers
    : Mark
    null

  • Java Aplications with Oracle XE

    ok, I need to conect a java aplication with a oracle db XE, so I was researching how could do that. them I downloaded a file JDBC14.jar but I don`t understand how continue? but you have another form to conect this, I will be thanks with you in advance.

    Pl try the XE forum - Oracle Database Express Edition (XE)
    HTH
    Srini

  • Java function with Dynamic config throws null pointer exception

    hi Experts,
       I am using dynamic config using java function in my message mapping.
      The source message has a field called "fname".
      The value of "fname" is the input to my java UDF.
      The java UDF code is:
       public String getDynamicFile(String fname, Container container) throws StreamTransformationException{
       String str = fname + ".xml";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey FileName = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","FileName");
    conf.put(FileName, str);
    return str;
       When I test this message mapping I get the following exception:
       Runtime Exception:[java.lang.NullPointerException: while trying to invoke the method com.sap.aii.mapping.api.DynamicConfiguration.put(com.sap.aii.mapping.api.DynamicConfigurationKey, java.lang.String) of an object loaded from local variable '<4>'] in class com.sap.xi.tf._<message mapping>_ method getDynamicFile[test, com.sap.aii.mappingtool.tf7.rt.Context@2e52cb31]
    What am I doing wrong in this UDF?
    Thanks
    Gopal

    Hi,
          Your UDF will run fine in an end to end execution,i.e, during runtime. However, if you want to test your message mapping test tab without the dynamic config UDF throwing an exception, encpasulate the code in a try catch block
    public String getDynamicFile(String fname, Container container) throws StreamTransformationException{
    String str = fname + ".xml";
    try{
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey FileName = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","FileName");
    conf.put(FileName, str);
    }catch(Exception ex){}
    return str;
    The above code should run fine when you test in the message mapping test tab.
    Regards

  • Oracle Function with out parameters

    Hi, I'm trying to access a stored function on an oracle server with 2 out parameters, 2 in parameters and an out ref cursor.
    PL/SQL looks like this
    nStatusCode OUT INTEGER,
    sStatusMsg OUT VARCHAR2,
    sUsrNr           IN VARCHAR2,
    sPassword           IN VARCHAR2,
    crsReturn OUT pck_cursor.retRecordSet
    I drag the function onto dataset designer and it successfully maps the results to the datatable, it maps datatypes for first out parameters to decimal and string.
    the method genearated for fill by looks like (out decimal?,out string,string, string, out object)
    problem is, everytime i try to call this function it gives me casting exceptions for the first 2 out parameters, for the decimal it's not specified in more detail. for the other one it says there was an exception casting from OracleString to string. If I change the PL/SQL function to leave the first 2 out parameters away it works fine. Do I manually need to change the TableAdapter definitions??

    Hi,
    I think I found the problem but not a good solution. It seems to be a problem with auto code generation for TableAdapters in the Dataset wizard. In the Parameter Definition for the Command I set DbType.Decimal and DbType.Sting for the SqlDbtype Property of the out params. The GetData and Fill Method is generated with Fill(out decimal? out1, out string out2). When I look in the generated code ith first sets the SqlDbtype as written but after this also the OracleDbtype to OracleDbType.Decimal and OracleDbType.Varchar2. The casting these types before returning the throws the exception. Any idea how to change this behavior?

Maybe you are looking for

  • Storm 9800 calendar display on homepage

    Hey, I'm having an issue ever since I uploaded the newest Storm update, my calendar appointments and reminders used to fill the homepage with upcoming events when I clicked on them.  Now, ever since the update, only the next three display and I can't

  • Read BMP File Requires Absolute Path

    I noticed something today regarding the Graphics Formats, Read JPG File, Read PNG File and Read BMP File vi's. It seems that when reading a JPG or PNG file, a relative path is OK, but when reading a BMP file, an absolute path is required. When the pa

  • How can we generate the reports in html or text file formats?

    Hi, Is there any package that can help in creating HTMLDB reports in .txt files or .html files? (Similar to TEXT_IO in Oracle Forms) How can we generate the reports in html or text file formats from HTMLDB? Thanks in Advance Renjith

  • How do I plug a non-USB microphone into a Mac Pro?

    Question from an audio newbie....I've got a 2009 Mac Pro desktop computer. I just bought a microphone headset. The headset has a two-pronged plug in, a green one for the headset (speakers) and a pink one for the microphone. My Mac Pro has two speaker

  • How to remove plugin container in firefox 14.0.1?

    Is there a way to remove plugin-container in firefox 14.0.1? Any extra process is unacceptable and I've always had plugin-container remove before. But from what I read it is needed to run the newest flash, so can gives us a option to automatically cl