Java in Stored Procedures

Hi all,
This is the Problem i am facing. Can anyone help please !!!!
I hv creaeted a java source file to print "Hello World" and compiled to create java class file. Now i hv both the .java and .class file under the directory c:\suresh\javaexam.
I tried loading the java file to the database using loadjava utility. I hv not done any modifications to the classpath or anything. I had jdk installed prior to Oracle installation in my machine.
The loadjava utility generates the following error message
unable to initialize threads : cannot find class java/class/thread. Could not create Java VM.
Here is the command i tried.
loadjava -u scott/tiger -resolve c:\suresh\javaexam\Dba.java.
Then i included all the jar files in jdk directory in the jreclasspath of loadjava.bat and tried the command again. Even then it is giving the same problem.
Can anyone please help me to overcome this ?
Problem 2.
I used Create Java command to load java in RDBMS. But when checked with user_objects, the status says Invalid. --- Why is this shows Invalid ? How to make it Valid ?
Advance Thanks for the Reply.
my e-mail id : [email protected]
Regards
PB Suresh

What is the Java version you are using. Is it 1.1.X or 1.2.X?
The loadjava command is a batch file on nt.
Set the CLASSPATH from the command line to the following.
set CLASSPATH=c:\jdk1.1.8\lib\classes.zip;c:\orant\jdbc\lib\classes111.zip;.
Now run the loadjava.
null

Similar Messages

  • Java call stored procedure with nested table type parameter?

    Hi experts!
    I need to call stored procedure that contains nested table type parameter, but I don't know how to handle it.
    The following is my pl/sql code:
    create or replace package test_package as
    type row_abc is record(
    col1 varchar2(16),
    col2 varchar2(16),
    col3 varchar2(16 )
    type matrix_abc is table of row_abc index by binary_integer;
    PROCEDURE test_matrix(p_arg1 IN VARCHAR2,
    p_arg2 IN VARCHAR2,
    p_arg3 IN VARCHAR2,
    p_out OUT matrix_abc
    END test_package;
    create or replace package body test_package as
    PROCEDURE test_matrix(p_arg1 IN VARCHAR2,
    p_arg2 IN VARCHAR2,
    p_arg3 IN VARCHAR2,
    p_out OUT matrix_abc
    IS
    v_sn NUMBER(8):=0 ;
    BEGIN
    LOOP
    EXIT WHEN v_sn>5 ;
    v_sn := v_sn + 1;
    p_out(v_sn).col1 := 'col1_'||to_char(v_sn)|| p_arg1 ;
    p_out(v_sn).col2 := 'col2_'||to_char(v_sn)||p_arg2 ;
    p_out(v_sn).col3 := 'col3_'||to_char(v_sn)||p_arg3 ;
    END LOOP ;
    END ;
    END test_package ;
    My java code is following, it doesn't work:
    Class.forName ("oracle.jdbc.driver.OracleDriver");
    Connection con = DriverManager.getConnection
    ("jdbc:oracle:thin:@10.16.102.176:1540:dev", "scott", "tiger");
    con.setAutoCommit(false);
    CallableStatement ps = null;
    String sql = " begin test_package.test_matrix( ?, ? , ? , ? ); end ; ";
    ps = con.prepareCall(sql);
    ps.setString(1,"p1");
    ps.setString(2,"p2");
    ps.setString(3,"p3");
    ps.registerOutParameter(4,OracleTypes.CURSOR);
    ps.execute();
    ResultSet rset = (ResultSet) ps.getObject(1);
    error message :
    PLS-00306: wrong number or types of arguments in call to 'TEST_MATRIX'
    ORA-06550: line 1, column 8:
    PL/SQL: Statement ignored
    Regards
    Louis

    Louis,
    If I'm not mistaken, record types are not allowed. However, you can use object types instead. However, they must be database types. In other words, something like:
    create or replace type ROW_ABC as object (
    col1 varchar2(16),
    col2 varchar2(16),
    col3 varchar2(16 )
    create or replace type MATRIX_ABC as table of ROW_ABC
    /Then you can use the "ARRAY" and "STRUCT" (SQL) types in your java code. If I remember correctly, I recently answered a similar question either in this forum, or at JavaRanch -- but I'm too lazy to look for it now. Do a search for the terms "ARRAY" and "STRUCT".
    For your information, there are also code samples of how to do this on the OTN Web site.
    Good Luck,
    Avi.

  • Can't publish java xml stored procedure

    I have written a java class to return values from the database as XML using the XSU, and am attempting to publish the class as a stored procedure. I have successfully created other java stored procedures, but am continually getting the following error on this one:
    ORA-29531: no method getItems in class foo/bar/Inbox
    To illustrate the interface which I am trying to implement, snippets from the java class and the Oracle package follow:
    ===========================================
    Java class:
    package foo.bar;
    import oracle.sql.CLOB;
    import other.stuff;
    public class Inbox {
    public static void getItems(int userID,
    CLOB[] xml)
    ===========================================
    Oracle package spec:
    PROCEDURE getItems(user_id IN PLS_INTEGER,
    buf IN OUT NOCOPY CLOB);
    Package body:
    PROCEDURE getItems(user_id IN PLS_INTEGER,
    buf IN OUT NOCOPY CLOB)
    AS LANGUAGE JAVA NAME
    'foo.bar.Inbox.getItems(java.lang.Integer,
    oracle.sql.CLOB[])';
    ===========================================
    I originally structured the class to return the CLOB, but altered the structure to handle the CLOB as an IN OUT parameter so that the NOCOPY option modifier could be used, as suggested in S. Muench's book. I was surprised to hear that Oracle creates an in-memory copy of the return value from a function (wish I'd known this before).
    All suggestions appreciated.
    null

    When I use JDeveloper's automatic Java Stored Procedure publishing feature, I get a PL/SQL spec that looks like this:
    CREATE OR REPLACE PACKAGE EXPERIMENTALWORK
    AUTHID CURRENT_USER AS
    PROCEDURE GETITEMS ("userID" IN NUMBER,
    "xml" IN OUT CLOB)
    AS LANGUAGE JAVA
    NAME 'foo.bar.Inbox.getItems(int, oracle.sql.CLOB[])';
    END EXPERIMENTALWORK;You still have to add the NOCOPY by hand, but perhaps the int versus java.lang.Integer is significant?

  • PL/SQL vs. Java stored procedures.

    After learning about PL/SQL I have to admit it looks ugly to me. Is there any concrete reasons why PL/SQL should be used over Java for stored procedures. I understand that PL/SQL is native to Oracle and procedures written in PL/SQL would probably out perform Java procedures, but what if performance was not the most critical issue. Looking at PL/SQL makes me think it would be hard to maintain.
    Thanks in advance.

    Hi
    There is a common mis-understanding here. 2008 will be the last year oracle is going to support Developer in Client server mode. Oracle does not claim to discontinue Developer, They are currently working on Developer Rel9i, which is truely a multi tiered archtecture. PLSQL will live as long as Oracle database lives.
    PLSQL is simple yet powerful language, it is getting better with each version. With the new 9i release, it is truely object oriented like any OO language like Java/C etc. Further you can override methods in Objects and override them in C, Java, PLSQL etc. What this means is that you can have a parent Object and have some method x implemented in PLSQL, you can then inherit another object from the parent object and override the same method x, this time you can write the method x in java or C. No other language can offer this feature. Further PLSQL also provides you with dynamic typing, like most other OO languages. These are some of the features of PLSQL.
    And ofcourse, the language you choose is purely a matter of choice. If you are going to write a database-centric application, PLSQL might be a right choice as it facilitates many things for us like exception handling, transaction etc.
    If you are writing a generic application that can interact with any database, then java might be a right choice as you and encapsulate the information in the language.
    HTH
    Arvind Balaraman

  • Export Java-based external stored procedure

    I've got a properly deployed external Java-based stored procedure deployed properly. I can see it by querying user_objects as well as user_java_classes. Is there any way I can export it so that I can deploy it in a different database? Please note that I mean a different way than performing a complete export, I just want to selectively export this external procedure.
    Thanks, Tom

    I would think that the following would work:
    expdp user/password directory=my_dir dumpfile=java.dmp include=java_source
    This would export the java source for the user performing the export. If you need to export java_source for another user, you would have to add
    schemas=other_schema
    Adding the other schema would only work if the user running the job was privileged.
    Dean

  • MySQL/j Stored procedure on Server Failure? is it a bug? workaround?

    Hi all, with the release of SE 6 pending, I thought that this issue should be addressed. As I'm not sure if it's a bug or not, I decided to post in this forum to see if anybody has haad experience with it, has a workaround or any other information that could be usefull.
    The issue:
    MySQL v5.x offers stored procedures. the MySQL/j connector has the ability to call these procedures.
    If you run the stored procedure localy through Java, the stored procedure executes perfectly.
    Once deployed onto a server, and the stored procedures on the same server in a mysql database and "ALL PRIVILAGES" including "EXECUTE ROUTINE" are granted. The stored procedure fails to run.
    The error returned by the mysql/j connector is this :
    "Driver requires declaration of procedure to either contain a 'nbegin' or 'n' to follow argument declaration, or SELECT privilege on mysql.proc to parse column types."
    Here is a link to a MySQL forum about the issue:
    http://forums.mysql.com/read.php?98,67532,67532#msg-67532
    So it appears that it is a java issue.
    Is there a workaround?
    Has anybody successfully been able to use Java with MySQL stored Procedures?? (Pretty sad if we havn't)
    Any help on this topic would be greatly appreciated.
    cheers!

    Yes, I read through the threads, that is Why I cam here after posting back with MySQL trying all the suggeestions, I still can't find the thread from the MySQL/J developer, I did find the one from a MySQL developer though.
    We can't actually change permissions oursevles with our currecnt Servlet host.
    So they changed permissions for us:
    We checked to see if we had permissions, All permissions are granted for the localhost.
    currently not sure how to check them for the '%' assignment
    Our host also tried to drop the procedurees and create them again with the invoker command, but this was also to no avail.
    I was also sure that it was a MySQL issue, but was hoping someobody had another method of a workaround.
    It seems to be something to do with Java wanting the metadata for registering output variables.

  • Error while deploying a Java Stored Procedure using JDeveloper

    Hi,
    I was going thru the Oracle By Example article: "Developing SQL and PL/SQL with JDeveloper". (http://www.oracle.com/technology/obe/obe9051jdev/ide1012/plsqlobe/obeplsql.htm)
    One of the items in this article is - "Creating and Deploying a Java Stored Procedure"
    I was able to create a java class, compile it. Created a deployment profile. created a pl/sql wrapper. While trying to deploy the java stored procedure, I am getting the following error:
    Invoking loadjava on connection 'hr_conn' with arguments:
    -order -resolve -thin
    errors : class package1/mypackage/JavaStoredProc
    ORA-29521: referenced name java/lang/StringBuilder could not be found
    The following operations failed
    class package1/mypackage/JavaStoredProc: resolution
    oracle.aurora.server.tools.loadjava.ToolsException: Failures occurred during processing
         at oracle.aurora.server.tools.loadjava.LoadJava.process(LoadJava.java:863)
         at oracle.jdeveloper.deploy.tools.OracleLoadjava.deploy(OracleLoadjava.java:116)
         at oracle.jdeveloper.deploy.tools.OracleLoadjava.deploy(OracleLoadjava.java:46)
         at oracle.jdevimpl.deploy.OracleDeployer.deploy(OracleDeployer.java:97)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:474)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:361)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:285)
         at oracle.jdevimpl.deploy.StoredProcProfileDt$Action$1.run(StoredProcProfileDt.java:383)
    #### Deployment incomplete. #### Oct 27, 2005 1:38:56 PM
    Appreciate your help on this..

    I am using Jdeveloper 10.1.3 Early Access Version. JDK comes with it. I also have another JDK on my machine (JDK1.4.2_09)

  • How to pass the parameter values to the stored procedure from java code?

    I have a stored procedure written in sqlplus as below:
    create procedure spInsertCategory (propertyid number, category varchar2, create_user varchar2, create_date date) AS BEGIN Insert into property (propertyid, category,create_user,create_date) values (propertyid , category, create_user, create_date); END spInsertCategory;
    I am trying to insert a new row into the database using the stored procedure.
    I have called the above procedure in my java code as below:
    CallableStatement sp = null;
    sp = conn.prepareCall("{call spInsertCategory(?, ?, ?, ?)}");
    How should I pass the values [propertyid, category, create_user, create_date) from java to the stored procedure?[i.e., parameters]
    Kindly guide me as I am new to java..

    Java-Queries wrote:
    I have a stored procedure written in sqlplus as below:FYI. sqlplus is a tool from Oracle that provides a user interface to the database. Although it has its own syntax what you posted is actually PL/SQL.

  • Error while executing java stored procedure from a pl/sql procedure

    We have a requirement where we need to execute JAVA code stored in an Oracle database (Java Stored Procedure). This code uses some JAR files which we have already loaded without any errors in the database.
    The class file was also loaded in the database without any errors. But when we execute the method of this class (JAVA code), it gives the following error:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.NoClassDefFoundError
    Is there any way of debugging the code and getting to know where exactly the problem is? Or, any tool/software available for doing the same.
    Any pointers would be of great help!
    Thanks in advance

    Hi Uday,
    My guess is that there is a problem with your java stored procedure that is causing the "ExceptionInInitializer" error to be thrown. According to the javadoc:
    is thrown to indicate that an exception occurred during
    evaluation of a static initializer or
    the initializer for a static variable
    Since I didn't see any of your code in your post, I can't help you much more, I'm afraid. Perhaps if you would provide some more details, I may be able to help you some more. I think the following details would be helpful:
    1. Complete error message and stack trace you are getting.
    2. The section of your java code that you think is causing the problem.
    3. Oracle database version you are using.
    Good Luck,
    Avi.

  • Unable to access Custom UDTs returned from a Java Stored Procedure

    Hi,
    I have a UDT in the DB :-
    create type contactrecord as object (
    CN_ID NUMBER(8),
    CN_TITLE VARCHAR2(40),
    CN_FIRST_NAME VARCHAR2(25)
    and this is the corresponding java class ContactDetails.java that maps to this UDT, that I loaded in the Aurora VM.
    package package1;
    mport java.sql.SQLData;
    import java.sql.SQLException;
    import java.sql.SQLInput;
    import java.sql.SQLOutput;
    public class ContactDetails implements SQLData
    private String sql_type;
    private long CN_ID;
    private String CN_TITLE;
    private String CN_FIRST_NAME;
    public String getSQLTypeName() throws SQLException
    return this.sql_type;
    //implementation of readSql
    public void readSQL(SQLInput stream, String typeName) throws SQLException
    sql_type = typeName;
    CN_ID = stream.readLong();
    CN_TITLE = stream.readString();
    CN_FIRST_NAME = stream.readString();
    public void writeSQL(SQLOutput stream) throws SQLException
    stream.writeLong(CN_ID);
    stream.writeString(CN_TITLE);
    stream.writeString(CN_FIRST_NAME);
    //getters and setters for the class vars go here.....
    There is another class A.java that has a java stored procedure/function, which I loaded into the Aurora VM
    Here is the class.
    package package1;
    public class A
    public static ContactDetails returnObject(String name )
         ContactDetails cd = new ContactDetails();
         cd.setCN_ID(1);
    cd.setCN_FIRST_NAME(name);
    return cd;
    Then I declared the call spec for A.returnObject() as
    FUNCTION returnObject(name varchar2) return contactrecord
    AS LANGUAGE JAVA
    NAME 'package1.A.returnObject(java.lang.String) return package1.ContactDetails';
    Then I tried to call the function returnObject through JDBC calls from a class in another VM.
    When I access the object returned by the function, I get a null object.
    Here is the Client code:
    CallableStatement cs = null;
    ResultSet rs = null;
    try
    cs = conn.prepareCall("{ ? = call returnObject(?) }");
    java.util.Map map = conn.getTypeMap();
    map.put("ADMIN.CONTACTRECORD", Class.forName("package1.ContactDetails"));
    conn.setTypeMap(map);
    cs.registerOutParameter(1, OracleTypes.STRUCT, "ADMIN.CONTACTRECORD");
    cs.setString(2, "John Doe" );
    cs.execute();
    ContactDetails cd = (ContactDetails)cs.getObject(1);
    System.out.println("contact first name is:-"+cd.getCN_FIRST_NAME()); //Null Pointer here..cd is null....:(
    if (cs != null) cs.close();
    catch(Exception e)
    e.printStackTrace();
    Although If I try to access the same function from a pl/sql block, I am able
    to access the contactrecord fields.
    What could be wrong ..???
    I could not find any error with the object mapping, as it works perfectly when I interact directly from my VM to the DB,
    without going thru the aurora VM.
    I am using a OCI driver to connect to the DB via JDBC.
    Thanx in advance for any help at all.
    -sk

    Shahid,
    I too have had bad luck in many cases with the automatic translation of Java types to PL/SQL and back. I think the SYS package on the PL/SQL side which handles some of the conversion is DBMS_PICKLER (there are equivalent Java classes which do the same in that world and seem to execute automagically when a conversion is needed). You might want to double-check the data type mappings against the DOC on OTN to make sure they map 1-1. Also make sure the permissions are granted against your objects to whoever is executing them, etc. Very often, I've resorted to passing simple scalar types between the two languages as in some cases the results with complex types are inconsistent.
    Sorry this isn't much help,
    -Dan
    http://www.compuware.com/products/devpartner/db/oracle_debug.htm
    Debug PL/SQL and Java in the Oracle Database

  • ORA-04030: out of process memory when using Java Stored Procedures

    Hello,
    I have a problem using Java Stored Procedures in Oracle 10g.
    My Java application performs http posts to a webservice and the response is parsed in order to populate some DB tables.
    There is a scheduled job which calls the Java Stored Procedure every x minutes.
    No matter of the 'x minutes' values - after about 160 - 200 calls I get this error:
    ORA-04030: out of process memory when trying to allocate 1048620 bytes (joxp heap,f:OldSpace)
    ORA-04030: out of process memory when trying to allocate 2097196 bytes (joxp heap,f:OldSpace)
    The job stops just while is posting the http request. The weird thing is that almost each time the first http post request I get this error:
    java.net.ConnectException: Connection refused
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
         at java.net.Socket.connect(Socket.java:426)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(DashoA6275)
         at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:140)
         at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:130)
         at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
         at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
         at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
         at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
         at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
    and the second try works fine.
    So, The out of process memory occured each time just before getting such an error, and I suspect to be a connection between these errors.
    Tech details:
    1. OS: WinXP
    2. Oracle 10.1.0.2.0
    3. To perform http post I use HttpClient 3.1 from Apache.
    4. I checked the http connection to be closed each time, and this is done.
    5. I checked the oracle statement and connection to be closed each time and this is done
    6. The JVM error (logged in .trc files of Oracle) is:
    java.lang.OutOfMemoryError
         at java.lang.Thread.start(Native Method)
         at sun.security.provider.SeedGenerator$ThreadedSeedGenerator.run(SeedGenerator.java:297)
    DB Settings details:
    Starting up ORACLE RDBMS Version: 10.1.0.2.0.
    System parameters with non-default values:
    processes = 200
    sessions = 225
    shared_pool_size = 159383552
    large_pool_size = 8388608
    java_pool_size = 104857600
    nls_language = AMERICAN
    control_files = C:\ORACLE\PRODUCT\10.1.0\ORADATA\XXXXXX\CONTROL01.CTL, C:\ORACLE\PRODUCT\10.1.0\ORADATA\XXXXXX\CONTROL02.CTL, C:\ORACLE\PRODUCT\10.1.0\ORADATA\XXXXXX\CONTROL03.CTL
    db_block_size = 8192
    db_cache_size = 29360128
    compatible = 10.1.0
    fal_client = XXXXXX
    fal_server = XXXXXXs
    log_buffer = 524288
    log_checkpoint_interval = 100000
    db_files = 70
    db_file_multiblock_read_count= 32
    db_recovery_file_dest = C:\oracle\product\10.1.0\flash_recovery_area
    db_recovery_file_dest_size= 2147483648
    standby_file_management = AUTO
    undo_management = AUTO
    undo_tablespace = undotbs_01
    undo_retention = 14400
    remote_login_passwordfile= EXCLUSIVE
    db_domain =
    dispatchers = (PROTOCOL=TCP) (SERVICE=XXXXXXXDB)
    remote_dependencies_mode = SIGNATURE
    job_queue_processes = 4
    parallel_max_servers = 5
    background_dump_dest = C:\ORACLE\PRODUCT\10.1.0\ADMIN\XXXXXX\BDUMP
    user_dump_dest = C:\ORACLE\PRODUCT\10.1.0\ADMIN\XXXXXX\UDUMP
    max_dump_file_size = 10240
    core_dump_dest = C:\ORACLE\PRODUCT\10.1.0\ADMIN\XXXXXX\CDUMP
    sort_area_size = 1048576
    sort_area_retained_size = 1048576
    db_name = XXXXXX
    open_cursors = 500
    optimizer_mode = FIRST_ROWS
    pga_aggregate_target = 25165824
    Any help would be appreciated. Thanks.
    Can be a problem with JVM threading under Oracle ?

    The server prcess failed to allocate more memory for large objects ( in Oldspace).
    If you Google ORA-04030, you will see several recommendations to work around this.
    The Java VM in the database already has HttpClient, i don't know why you are loading the Apache HttpClient but this might not be the surce of the problem.
    Kuassi http://db360.blogspot.com

  • Speed test: PL/SQL vs. Java Stored Procedures

    I performed tests on these two procedures:
    ===========================================
    // Create a Statement
    Statement stmt = conn.createStatement (ResultSet.TYPE_SCROLL_INSENSITIVE,
    ResultSet.CONCUR_UPDATABLE);
    // Query the table
    ResultSet rset = stmt.executeQuery ("select SIFOB, SIFRA_GU from sezko");
    while (rset.next ()) {
    salary = rset.getInt(1);
    rset.updateInt (1, salary + 1);
    salary = rset.getInt(2);
    rset.updateInt (2, salary + 1);
    rset.updateRow();
    } // while
    conn.commit();
    // Close the RseultSet
    rset.close();
    // Close the Statement
    stmt.close();
    ===========================================
    procedure updateTable is
    cursor c_updateTable is select rowid, SIFOB, SIFRA_GU from sezko;
    begin
    for r_updateTable in c_updateTable loop
    update sezko set SIFOB = SIFOB + 1, SIFRA_GU = SIFRA_GU + 1 where rowid = r_updateTable.rowid;
    end loop;
    commit;
    end;
    ===========================================
    First procedure is written in Java (as Java Stored procedure) and second is PL/SQL.
    Java is about 10x slower than PL/SQL code.
    Can you explain bad performance results?
    thank you
    Matic & Ales

    Hi,
    I suppose the problem is not with the connection object,but with make connection to the database for every executeupdate or executeupdaterow called .Similarly for fetching the data from the database you
    can use the fetch size technique.Please check the 8.1.6 Java Developers guide for using this.
    Update Batching(For Batch updates and commits)
    Fetch Size(For Batch fetching)
    Oracle Row Pre-Fetching
    Regards
    Anand
    null

  • Calling the Java Method in PL/SQL Java Stored procedure errors out

    Hi,
    I could not find a suitable thread to post my PL/SQL question so iam posting it here.........
    I have written a java class by name XYZ which has a method ABC for which there are 9 arguements being passed and its a VOID method.
    This java class has been loaded into ORACLE using DBMS_JAVA.LOADJAVA pkg, Now this class is being called in the oracle as a JAVA Stored procedure...... When ever im trying to call the procedure it throws the following error
    ORA-29531: no method
    *Cause:    An attempt was made to execute a non-existent method in a
    Java class.
    *Action:   Adjust the call or create the specified method.
    The code snippet as follows
    JAVA CODE:
    Class xyz
    public static void Abc (String hostName,
    int port,
    String serviceURL,
    String soapAction,
    int timeOut,
    String wsUser,
    String wsPasWd,
    String keyStore,
    String keyStorePasWd)
    //method implementation
    JAVA STORED PROCEDURE:
    create OR REPLACE procedure ABC_JAVA_SP_CALL
    (p_hostname in varchar2, p_port in number, p_serviceurl in varchar2, p_soapaction in varchar2, p_timeout in number, p_wsuser in varchar2, p_wspasswd in varchar2, p_ks_path in varchar2, p_ks_passwd in varchar2)
    as
    language java
    name 'xyz.Abc(java.lang.String, int, java.lang.String, java.lang.String, int, java.lang.String, java.lang.String, java.lang.String, java.lang.String)';
    When i try to call
    declare
    p_hostname varchar2(100);
    p_port number;
    p_serviceurl varchar2(100);
    p_soapaction varchar2(100);
    p_timeout number;
    p_wsuser varchar2(100);
    p_wspasswd varchar2(100);
    p_ks_path varchar2(100);
    p_ks_passwd varchar2(100);
    begin
    //SP which returns the values for the required parameters.
    comppkg.getvcsinfo(
    p_hostname,
    p_port ,
    p_serviceurl,
    p_soapaction,
    p_timeout,
    p_wsuser,
    p_wspasswd,
    p_ks_path,
    p_ks_passwd
    Layer7_icengc_ws_tes(p_hostname,
    p_port ,
    p_serviceurl,
    p_soapaction,
    p_timeout,
    p_wsuser,
    p_wspasswd,
    p_ks_path,
    p_ks_passwd);
    end;
    This thing ends up with
    29531. 00000 - "no method %s in class %s"
    *Cause:    An attempt was made to execute a non-existent method in a
    Java class.
    *Action:   Adjust the call or create the specified method.
    Im not understanding what wrong am i doing
    pls help
    Edited by: madhusudan on Feb 12, 2013 8:07 PM

    Hello,
    there is the forum {forum:id=65} for questions about using Java within Oracle.
    Regards
    Marcus
    Edited by: Marwim on 13.02.2013 07:56
    I could not find a suitable thread to post my PL/SQL question so iam posting it here.........You got the hint to the correct forum alread in another thread {message:id=10837976}
    And if you think this is not related to Java but PL/SQL, then you should ask in {forum:id=75}

  • Java stored procedure vs. PL-SQL vs. external java program

    Hi,
    I'm using a stored procedure for running a query and a few consequent updates. Currently I'm using Java stored procedure for that, which was my choice for simplicity on one hand, and running with the DB on the other.
    In my tests, strangely enough it came out that running as java stored procedure was 3-4 times slower than running as a java program outside the database. I don't know how to explain this, and I wonder if switching to PL/SQL will improve the performance of the code.
    Any experiences? recommendations?
    Thanks,
    Dawg

    In my tests, strangely enough it came out that running as java stored procedure was 3-4 times slower than running as a java program outside the database. I don't know how to explain this, and I wonder if switching to PL/SQL will improve the performance of the code.This isn't strange at all. See: Oracle's JVM (Aurora) is an independent Java Virtual Machine implementation, in accordance to specification. It implements all necessary parts of it (I think so). When you use an external JVM (I assume it's Sun's HotSpot JVM) you use completely different product. It is implemented in different way, it has many different code parts.
    One of the biggest differences between Oracle's JVM and Sun's JVM is [Just-in-Time compiler|http://en.wikipedia.org/wiki/Just-in-time_compilation]. Oracle has implemented it only in the 11g version of database, i.e. 2 years ago, while Sun performed it back in 2000 and continues to improve it for the last 9 years. That would explain obvious differences between Java program inside and outside the DB: they are executed in absolutely different worlds. Diffs could be up to 10x times or more - that's not unusual.
    If you are on 10g and want to compare performance of stored Java procedure vs external program, then you might use additional command-line instruction for external program to disable JIT:
    -XintPS. I wouldn't use Java for your task - that's a total overkill. Use simple SP instead.

  • Empty strings when passing a Java object to a Stored Procedure

    Hi,
    I'm using the interface SQLData to pass Java objects to StoredProcedures. All the object's attributes 'arrive' to the Stored Procedure ok, except the strings, which are empty.
    Here is my Oracle object:
    TYPE OBJ_ASJFF_OBJ1 IS OBJECT (
    ARG1 CHAR(3),
    ARG2 NUMBER(4),
    ARG3 CHAR(4),
    ARG4 NUMBER(7),
    ARG5 NUMBER(13,2),
    ARG6 CHAR(1));
    The nested table of that object:
    TYPE TAB_ASJFF_OBJ1 AS TABLE OF OBJ_ASJFF_OBJ1;
    The procedure declaration:
    PROCEDURE Pup_Instaura_Processo (                              x_crCert IN TAB_ASJFF_OBJ1,
    x_cResult OUT CHAR(4)
    My SQLData implementation:
    public void writeSQL(SQLOutput stream) throws SQLException {
                   stream.writeString(getArg1());     
                   stream.writeInt(getArg2().intValue());
                   stream.writeString(getArg3());          
                   stream.writeLong(getArg4().longValue());     
                   stream.writeBigDecimal(getArg5());
                   stream.writeString(getArg6());
    Can anybody help me?
    Thanks in advance
    Rui Gonçalves

    not exactly what you wanted but ingredients can be found at
    - JPublisher's docuemntation (especially "Type Mapping Support Through PL/SQL Conversion Functions")
    - http://otn.oracle.com/sample_code/tech/java/jsp/Oracle9iJSPSamples.html (Best Hotels PL/SQL Sample )
    - http://otn.oracle.com/tech/xml/xdk_sample/xdksample_093001i.html
    hope this helps
    Kuassi
    I have a Java Stored procedure which takes an instance of a different java object as its parameter.
    I need to do this from a pl/sql package - can anyone point me to a sample etc (looked on the website but don't see one) ?
    Andrew

Maybe you are looking for

  • Adobe Form (data extraction error)

    Hi Experts, i'm trying extract data from PDF file. (Adobe Offline scenario). I'm getting this XML runtime error. could anybody can help me to solve this problem. This is my code , CALL TRANSFORMATION id SOURCE XML lv_xml_data_string RESULT T_sums    

  • Set parameter and call transaction

    Hi. To use the call transaction with the skip first screen option we have to use the set parameter statement. Depending on the PID which the technical specs of the fields contain, it is possible to preset these values. My query is that if the screen

  • I keep getting a message about a problem with the plug in container for firefox. what does it mean?

    I am getting a pop up box saying that there is a problem with the plug in container for firefox. It keeps saying do I want windows to find a fix for it and close it or do I just want to close the program. What is this plug in container for firefox an

  • No Apple boot screen on new iMac - Just black with white writing on boot

    Hi All, I have just purchased a new 3.06Ghz iMac and whenever I turn it on, or shut down, I do not get the Apple boot screen, I just get a black screen with a long list of white writing on it. This appears for about 5 seconds and then the usual deskt

  • Associating Custom policies from admin console

    As mentioned in this link http://e-docs.bea.com/wls/docs92/ConsoleHelp/taskhelp/webservices/ConfigureWSPolicyFile.html we can associate custom ws-policies at runtime. I am facing problems creating a shared J2EE library with custom policies. Has anyon