Re   Java Stored Procedure Problem

Ben
There appear to be some problem with the forum. It doesn't want to show my response to your post with the subject "Java Stored Procedure Problem". See the answer to this thread for an example of how to do this...
Is there a SAX parser with PL/SQL??

Ben
There appear to be some problem with the forum. It doesn't want to show my response to your post with the subject "Java Stored Procedure Problem". See the answer to this thread for an example of how to do this...
Is there a SAX parser with PL/SQL??

Similar Messages

  • DBMS_JOB on Java Stored Procedure problem

    Hi all,
    (running on Oracle 9i : 9.2.0.7.0 64bit on HP/UX)
    I have a Java Stored procedure that reads a table
    One of the fields in this table is a CLOB containing some more SQL.
    We then executeQuery() that SQL (and e-mail the output).
    (Obviously I also have PL/SQL wrapper around it, which we'll call PROCNAME).
    For certain pieces of SQL, this second executeQuery() fails throwing ORA-00942, but only when run from a DBMS_JOB(!).
    Calling "CALL PROCNAME('argument')" from sqlplus/toad works fine, but setting "PROCNAME('argument')" to run as a DBMS Job fails on some SQL with the above error. (All as the same username).
    java.lang.StackTraceElement doesn't seem to exist in Oracle java, so the only error I have to go on is e.getMessage() from SQLExecption which returns:
    ORA-00942: table or view does not exist
    Any help at this strangeness would be appreciated!
    nic

    Hi Cris:
    May be is a problem of the effective user which is running the procedure.
    Which is the auth_id directive at the PLSQL call spec?
    Look at this example procedure UploadNews for example:
    http://dbprism.cvs.sourceforge.net/dbprism/cms-2.1/db/cmsPlSqlCode.sql?revision=1.21&view=markup
    this procedure calls to the cmsNews.doImport which is implemented as Java Stored Procedure.
    Also check if your loadjava operation is not using -definer flag.
    Best regards, Marcelo.

  • Java stored procedure problem(oracle db)

    HI,
    we have a java stored procedure with the following definition, and that works as we want it to:
    CREATE OR REPLACE FUNCTION processBulletin(in_varchar VARCHAR2) RETURN VARCHAR2
    AS LANGUAGE JAVA
    NAME 'JavaParser.Bufr_Ingest.processBulletin(java.lang.String) return java.lang.String';
    And the Java portion:
    public static String processBulletin(String in_bull)
    ... do something with in_bull
    The problem is that we've recently discovered that the 32767 size restiriction on the input parameter varchar2 is too small. I don't want to rewrite the entire Java procedure. I figured the simplest (or at least temporary)solution would be to have the Java procedure accept a CLOB, convert that clob to a string and continue as it would. I was hoping someone might be able to tell me if the following would be possible:
    CREATE OR REPLACE FUNCTION processBulletin(in_clob CLOB) RETURN VARCHAR2
    AS LANGUAGE JAVA
    NAME 'JavaParser.Bufr_Ingest.processBulletin(oracle.sql.CLOB) return java.lang.String';
    And the Java portion:
    public static String processBulletin(oracle.sql.CLOB in_clob)
    String in_bull = clob_in.getSubString(1, (int)clob_in.length());
    ... do something with in_bull
    Thanks

    I don't know about Java stored procedures, but in JDBC you usually use streams to work with CLOBS. Here's Oracle JDBC Developers Guide, Working with LOBs

  • Java Stored Procedure Problem

    Hi all,
    I was able to deploy the Java class into the database (the message says Success). And then I am able to desc MyJavaSproc name in SQL*Plus and see the Pl/SQL parameter and return types. But when I use either call or select from dual, it tells me the the Java class (MyJavaName) is not there. The Oracle error is this: ORA-29540: class MyJavaName does not exist. I am running 10gR2. I did encounter a problem when I first tried to deploy using J2SE 1.5 as source and target and JDev suggested that I change that to an earlier version. I changed that to 1.4 and then deployed successfully.
    Could someone help me with this? Thanks a lot.
    Ben

    Thanks. I created a simple file Java class with JDev (10g 1.3). I have some static methods (according to Oracle docs) in the class. Then by following JDev's help doc, I created a deployment profile for the project using JDec. I then added the Java methods that I wanted to deploy as sprocs. As I said, after I changed the J2SE from 1.5 (the default) to 1.4, the deployment was successful. I can see it using desc in SQL*Plus. I can also see it in the database connection tab in JDev. I can open the class stub created by JDev, and the sprocs and funcs are listed under Functions and Procedures on the database connection tab.
    Thanks.
    Ben

  • Transformation to WORD from XSLT with java stored procedure - PROBLEM

    Hi all,
    I'm building a java function for transformation of xml document through .xslt scheme to WORD. I use xalan.
    Now, everything works fine if I run the java function on the client VM
    But on the server where the classes needed for the transformation are loaded, it crashes with a strange exception
    nulljava.lang.NullPointerException
    Now I've located the problem, and it occurs in this line in the java code:
    transformer.transform( new StreamSource(xmlFile),  new StreamResult(osIzlez));
    (where xmlFile is the source for the transformation, and the transformer is configured with the proper .xslt scheme, osIzlez points to a bytearraystream of a blob in the database where the .doc file is going to be generated and loaded)
    I also found out that the NullPointerException occurs because the transformer is actually null on the server (although it's configured with the .xstl scheme and should not be null ! ), but on the client it's never null!
    What could be the problem, does anyone have an IDEA?
    Edited by: Daniel Kiprijanovski on 17.9.2009 03:07

    OK, i found out that there's a reported bug about that exception on the java VM. I found a way arround it however.
    Thanks,
    Daniel K.

  • EJB calling Java Stored Procedure / Problem sending mail

    I have a test code very similar to the sample - actually
    copied it from there. When i want to send a mail from my 9iR2 database, i get the following exception:
    javax.mail.NoSuchProviderException: No provider for Address type: rfc822
    at javax.mail.Session.getTransport(Session.java:516)
    at javax.mail.Transport.send0(Transport.java:155)
    at javax.mail.Transport.send(Transport.java:81)
    at cwt.exception.CWTPublicException.sendMail(CWTPublicException.java:97)
    at cwt.sp.Test.testExceptions(Test.java:42)
    When I use the Transport class to explicitly set 'smtp' as transport with
    message.saveChanges();
    Transport transport = session.getTransport("smtp");
    transport.connect(bundle.getString("smtp-host"), bundle.getString("smtp-user"),
    bundle.getString("smtp-pwd"));
    transport.sendMessage(message, message.getAllRecipients());
    transport.close();
    then i also get an exception:
    javax.mail.NoSuchProviderException: No provider for smtp
    at javax.mail.Session.getProvider(Session.java:289)
    at javax.mail.Session.getTransport(Session.java:483)
    at javax.mail.Session.getTransport(Session.java:464)
    at cwt.exception.CWTPublicException.sendMail(CWTPublicException.java:101)
    at cwt.sp.Test.t[i]Long postings are being truncated to ~1 kB at this time.

    Hi,
    This exception usualy occurs when the handlers haven't been imported in your application.
    Please check whether you have imported following in your source code.
    import javax.mail.*;
    import javax.mail.internet.*;
    Also make sure that you have loaded " latest " mail.jar and activation.jar into the database.
    Cheers
    --Venky                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Problem of java stored procedure

    hi,
    now I use the oracle9i JDeveloper9.0.3.1 to develop java stored procedure and then publish it to oracle9i database.
    In the database I create PL/SQL procedure to invoke the java stored procedure.But I encounter the problem,that is ,when I run the PL/SQL procedure ,it throw the java.lang.NullPointerException ,while the java class,the java stored procedure can run correctly invoked by the main class of java.The code of the java stored procedure is as follows:
    import java.sql.*;
    import java.util.Properties;
    public class SQLServerEventDistribute
    public static void sqlServerSaveData(String hostName,String databaseName,String user,String password,String tableName,int x1,int y1,int x2,int y2,String ip)
    String url="",sql="",userName="",passwd="";
    Connection connection;
    Statement statement;
    url="jdbc:microsoft:sqlserver://"+hostName+":1433;DatabaseName="+databaseName+";User="+user+";Password="+password;
    sql="INSERT INTO "+tableName+" VALUES("+x1+","+y1+","+x2+","+y2+",'"+ip+"')";
    Properties property=new Properties();
    property.setProperty(userName,user);
    property.setProperty(passwd,password);
    try
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    // DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
    connection=DriverManager.getConnection(url,property);
    statement=connection.createStatement();
    statement.execute(sql);
    }catch(ClassNotFoundException connectSQLServerEx)
    System.out.println(connectSQLServerEx.getMessage());
    catch(SQLException connectSQLServerEx)
    System.out.println(connectSQLServerEx.getMessage()+connectSQLServerEx.getErrorCode());
    the main class is as follows:
    public class Test
    public static void main(String[] args)
    SQLServerEventDistribute.sqlServerSaveData("gsm","gsmd","sa","sa","IPBinding",11,45,24,21,"23.1.248.12");
    and the PL/SQL procedure is as follows:
    PROCEDURE TEST AS
    BEGIN
    SQLSERVERSAVEDATA('gsm','gsmd','sa','sa','IPBinding',11,45,24,21,'23.1.248.22');
    END;
    How can I deal with it?
    can you tell me?
    thanks

    Hi JavaQQ,
    This is just a guess, but I think you need to load the
    Micro$oft SQLServer JDBC driver into the Oracle
    database (using the "loadjava" utility).
    In any case, there are several ways -- apart from JDBC
    -- for accessing a different database from within an
    Oracle database. Have you tried searching the Oracle
    Web sites for suitable products?
    Hope this helps.
    Good Luck,
    Avi.abramia ,thank you very much.
    but I have load the Microsoft SQLServer JDBC driver into the Oracle database .
    When I debugged the PL/SQL procedure,the exception was thrown at line connection=DriverManager.getConnection(url,property);
    What's the problem with it?

  • Problem passing REF CURSOR to JAVA STORED PROCEDURE

    Hi,
    I've written a small Java class with a static method and
    imported that into Oracle 8i. The method expects a
    java.sql.ResultSet object as parameter. According to the
    documentation of Oracle, a REF CURSOR (cursor variable) maps to
    java.sql.ResultSet in JDBC.
    The definition of the Java Stored Procedure was accepted without
    problems:
    CREATE OR REPLACE PROCEDURE RESULTSETPASSINGTESTPROC (row
    WASTypes.GenericCurType)
    as language java
    name 'sqlj.ResultSetPassingTest.testResultSetPassing
    (java.sql.ResultSet)';
    WASTypes is a package containing the definition of the generic
    cursor:
    CREATE OR REPLACE PACKAGE WASTYPES
    is
    TYPE GenericCurType IS REF CURSOR;
    END WASTypes;
    In a function I'm opening the cursor via
    'Open cursorVariable for sqlStatement';
    Then this cursor variable is passed to the java method and the
    error ORA-03113 is shown.
    I tried to solve the problem by changing the type of the
    parameter to oracle.sql.REF without success.
    Does anybody know what wents wrong?
    Thanks in advance.
    Jan

    Hi,
    I've written a small Java class with a static method and
    imported that into Oracle 8i. The method expects a
    java.sql.ResultSet object as parameter. According to the
    documentation of Oracle, a REF CURSOR (cursor variable) maps to
    java.sql.ResultSet in JDBC.
    The definition of the Java Stored Procedure was accepted without
    problems:
    CREATE OR REPLACE PROCEDURE RESULTSETPASSINGTESTPROC (row
    WASTypes.GenericCurType)
    as language java
    name 'sqlj.ResultSetPassingTest.testResultSetPassing
    (java.sql.ResultSet)';
    WASTypes is a package containing the definition of the generic
    cursor:
    CREATE OR REPLACE PACKAGE WASTYPES
    is
    TYPE GenericCurType IS REF CURSOR;
    END WASTypes;
    In a function I'm opening the cursor via
    'Open cursorVariable for sqlStatement';
    Then this cursor variable is passed to the java method and the
    error ORA-03113 is shown.
    I tried to solve the problem by changing the type of the
    parameter to oracle.sql.REF without success.
    Does anybody know what wents wrong?
    Thanks in advance.
    Jan

  • Java Stored Procedure Deployment Problem with JDev 3.1.1.2

    Dear JDeveloper Team:
    I am having a problem deploying a test Java stored procedure to the database. In the Deployment Profile Wizard Connection tab, it displays no connection in the connection dropdown even though I have defined some connections that have been sucessfully connected to the database.
    Please help.
    Thanks,
    Tom

    Tom,
    Verify that your Connections are valid as follows:
    Double Click on the Connections folder of JDeveloper Navigator.
    This opens up the Connection Manager.
    Make sure you have defined JDBC Connections.
    Pick your connection of intrest and select Edit... and then press the Test button to test the conneciton.
    If this is a valid JDBC connection, then it should appear later when you run the deployment wizard.
    -John

  • Problem in running a java stored procedure&optimum settings for this needed

    hi
    we are using java stored procedures to read huge data from database tables and transfer them to another system.
    the procedure is running fine but it fails after transferring 60000 records, the execution of procedure here does not terminate but keeps running with out performing any data transfer....since it does not give any error it is difficult for us to know what the actual problem is !!!!!!
    i have checked the code many a time and i dont see any infinite loops in that code.
    please give any pointers on why this might be happening?
    please also give all the parameters which need to be taken care of while running a java stored procedure
    thanks
    regards
    asif

    But the same thing works fine with a jdbc program
    the table name is converted
    The same convert.transform method is being used to do the conversion
    please help
    ISQL is similar to SQL prompt inOracle
    it is like,
    ISQL>
    Regards
    khurram

  • Problem In creating Java stored procedure- Urgent

    Hi Guys,
    I try to create a simple Java stored procedure but I get the following error message. Can you help me to sort out the problem please?.
    SQL> create or replace and compile java source named "Hello"
    2 as
    3 public class Hello {
    4 public static String hello()
    5 {
    6 return "Hello Oracle World";
    7 }
    8 }
    9 /
    Warning: Java created with compilation errors.
    SQL> show error java source Hello;
    No errors.
    Thanks in advance
    anthony
    null

    I had a similar issue, the reason for that was picking the incorrect partner link.
    Make sure the name of the selected partner link in the invoke output variable is matching with the Assign, in you case lets say you mapped the
    Invoke
    output variable is invoke_1_CallStoredProcedure_OutputVariable ( not nvoke_1_CallStoredProcedure_OutputVariable_1)
    From
    <Invoke_1_CallStoredProcedure_OutputVariable>
    <LF_STATUS>
    To
    P_lf_status ( variable)
    most of the time multiple variables are created when we try to select the output variable s in the Invoke.

  • Problem executing a Java Stored Procedure from Forms6i

    I'm executing a Stored Procedure which invokes a Java Stored procedure.Till the invoking it works fine but for accessing a particular class it gives an error:
    PDE-PLU022 Don't have access to the stored program unit XMLPARSERCOVER in schema CARE
    where care is the schema name....
    Please assist me for this...

    hi Jignesh
    Maybe you can find some useful information in:
    "Oracle Database Java Developer's Guide"
    http://download-west.oracle.com/docs/cd/B14117_01/java.101/b12021.pdf
    success
    Jan Vervecken

  • Problem with static vars of SQLJ java stored procedure

    Hi,
    When I'm calling a PL/SQL stored procedure that call a Java stored procedure from another Java stored procedure, the second call to the Java stored procedure does not see the first Java stored procedure static variables.
    Why is that?
    Can I configure it to work otherwise so all the Java stored procedure calls in this session will share the same static variables?
    Thanks

    Hi:
    Remove your ; at the end of the sql string.
    String sql = "SELECT VERSION_OFA FROM XX_PARAMETERS";
    I don't know why JDev accept the ; at the end of string in a prepare statement but AFAIK its not legal.
    If your are using the SQL pane of JDev may be the tool strip the ; for you.
    Best regards, Marcelo.

  • Problems with java stored procedure.

    I have a java stored procedure that uses a package called RmiJdbc
    which allows calling remote JDBC data sources from any java capable
    machine.
    I've loaded the RmiJdbc classes into oracle via the loadjava
    command and everything seems to come up valid.
    The stored procedure does a Class.forName() to get the driver
    registered, than attempts to connect to the remote RMI driver.
    The particular line it dies on is this (see the error below):
    c = DriverManager.getConnection("jdbc:rmi:" + rmiHost + "/" + url);
    A mangled version of this (minus the Oracle specific stuff) works
    from the command line correctly. Can somebody point me in a
    direction to figure out what's going on here?
    THanks,
    Eric
    Oracle9i Enterprise Edition Release 9.0.1.3.0 - 64bit Production
    With the Partitioning option
    JServer Release 9.0.1.3.0 - Production
    ORACLE_HOME = /oracle/v901ee
    System name: HP-UX
    Node name: athena
    Release: B.11.00
    Version: A
    Machine: 9000/889
    Instance name: PASDB2
    Redo thread mounted by this instance: 1
    Oracle process number: 13
    Unix process pid: 7839, image: oracle@athena (TNS V1-V3)
    *** SESSION ID:(8.547) 2002-08-15 15:41:27.221
    java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
    java.lang.NullPointerException
    java.lang.NullPointerException
    at sun.rmi.server.LoaderHandler$LoaderKey.<init>(LoaderHandler.java)
    at sun.rmi.server.LoaderHandler.lookupLoader(LoaderHandler.java)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java)
    at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java)
    at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
    at java.io.ObjectInputStream.inputArray(ObjectInputStream.java)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
    at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java)
    at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java)
    at java.io.ObjectInputStream.inputObject(ObjectInputStream.java)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java)
    at sun.rmi.registry.RegistryImpl_Stub.lookup
    at org.objectweb.rmijdbc.RJConnection.<init>(RJConnection:83)
    at org.objectweb.rmijdbc.Driver.connect(Driver:135)
    at java.sql.DriverManager.getConnection(DriverManager.java)
    at java.sql.DriverManager.getConnection(DriverManager.java)
    at TurnoverInfoPlusInterface.insertInterfaceRecords(TurnoverInfoPlusInterface:53)
    java.sql.SQLException: Error unmarshaling return; nested exception is:
    java.lang.NullPointerException
    at org.objectweb.rmijdbc.Driver.connect(Driver:140)
    at java.sql.DriverManager.getConnection(DriverManager.java)
    at java.sql.DriverManager.getConnection(DriverManager.java)
    at TurnoverInfoPlusInterface.insertInterfaceRecords(TurnoverInfoPlusInterface:53)

    More info...I'm also seeing "ORA-03113: end-of-file on communication channel". I checked the user trace file and didn't get much help...it indicated an "exception signal: 11" and core-dump type stuff that had no meaning to me.

  • Performance problem with java stored procedure

    hi,
    i developped a java class, then I stored it in Oracle 8.1.7.
    This class contains several import of other classes stored in the database.
    It works, but the execution perfomances are disappointing. It's very long. I guess, that's because of the great number of classes to load that are necessary for my class execution.
    I tried to increase the size of the java pool (I parameter 70 Mo in the java_pool_size parameter of the init.ora), but the performance is not much better.
    Has anyone an idea to increase the performance of this execution of my class ?
    In particular, is there a way to keep permanently in memory the java objects used by my class ?
    Thanks in advance
    bye
    [email protected]
    null

    before running Java, the database session needs to be Java enabled; this might be the reason why it is taking so long. If this is the case, you should see an improvement in subsequent calls, once a database session is Java enabled, other users can benefit from it.
    Kuassi
    I have some performance issue with java stored procedure. Hope some one will be able to help me out. I'm using java stored procedures in my application and basically these procedures are used to do some validation and form the XML message of the database tables. I have noticed that when I call the PL/SQL wrapper function, it is taking time to load the java class and once the class is loaded the execution is faster. Most of the time is spent for loading the class rather than executing the function. if I reduce the class load time, I can improve the performance drastically. Do any one of you know how to reduce the class load time. The following are the platform and oracle version.
    O/S: IBM AIX
    Oracle: 8.1.7

Maybe you are looking for

  • Installing Adobe photoshop 9 via disk

    I purchased Photoshop elements 9 and when i put the disk in my computer it does not start the install process. I can view the files on my D drive but do not know which one to pick to run the install.  We just got a new computer so I am trying to inst

  • How to Generate DDL Statement for PSAPROLL Tablespace on Oracle9i-HP_UX

    Hi, I am having SAP R3 46C installed with Oracle 9i on HP_UX 11i system. I want to generate required DDL statements for PSAPROLL Tablespace/Rollback Segments as Backup/recovery purpose, before converting it into PSAPUNDO. Its easy to find & store req

  • What driver supports a hp laserjet 4200n printer in windows 7

    I am trying to add a laserjet 4200n to my new hp computer.  It doesn't seem to be supported by windows 7  every time I try to print I get error printing message.

  • Firewall - Deny IP range

    Hi I'm trying to deny a given IP range from accessing any service on our server. I'm having problems with php header-injection attacks, and want to ban the offending IP ranges outright. I have them listed in their own address group, and all services

  • RFC Server Groups affecting RFC performance

    Hi SDN performance experts I am investigating an issue with RFC performance within our ECC5 system. ST03N shows an average total RFC response time across all instances has grown from a monthly average of 352ms in March to 1500ms in October. However,