How to use signed classes/Jars in Java Stored Procedure?

I am using java encryption API in my java application that I want to deploy as java stored procedure. The API is kept in the signed jar files.
The Application is running in the MS-DOS environment but not in Oracle8i.
It gives me following error.
java.lang.ExceptionInInitializerError: java.lang.SecurityException: Cannot set
up certs for trusted CAs
at javax.crypto.b.<clinit>([DashoPro-V1.2-120198])
at javax.crypto.KeyGenerator.getInstance([DashoPro-V1.2-120198])
at DesKey.GenerateKey(DesKey.java:63)
declare
ERROR at line 1:
ORA-29532: Java call terminated by uncaught Java exception:
java.lang.ExceptionInInitializerError
ORA-06512: at line 4
(Note: I have enabled the java output in SQL Plus editor otherwise it will give only the second part of error that starts from ERROR at line 1:)
please guide me how to solve this problem.
Salman Hameed

Salman,
If you do not get a reply on this forum, I recommend you post this question on the Oracle JVM discussion forum as well.
In addition, I would recommend checking the documentation for Oracle8i. The Oracle8i Java Developer's Guide, the Java Stored Procedures Guide, and the JDBC Developer's guide may have some information on this topic. You can get to this doc from the OTN Documentation page. Click on Oracle8i, then General Documentation, Release 2 (8.1.6), then scroll down to see the link for the Oracle8i Java Developer's documetation. All of the books mentioned above are available from that link.

Similar Messages

  • Invoking "java myClass" using Runtime.Exec from a Java Stored Procedure

    Hi All,
    This is regarding the use of Runtime.getRunTime().exec, from a java programme (a Java Stored Procedure), to invoke another Java Class in command prompt.
    I have read many threads here where people have been successuful in invoking OS calls, like any .exe file or batch file etc, from withing Java using the Runtime object.
    Even i have tried a sample java programme from where i can invoke notepad.exe.
    But i want to invoke another command prompt and run a java class, basically in this format:
    {"cmd.exe","java myClass"}.
    When i run my java programme (in command prompt), it doesnt invoke another command prompt...it just stays hanging.
    When i run the java programme from my IDE, VisualCafe, it does open up a command prompt, but doesnt get the second command "java myCLass".
    Infact on the title of the command prompt (the blue frame), shows the path of the java.exe of the Visual Cafe.
    and anyway, it doesnt run my java class, that i have specified inside the programme.
    Even if i try to run a JAR file, it still doesnt do anything.
    (the JAR file other wise runs fine when i manually invoke it from the command prompt).
    Well, my question is, actually i want to do this from a Java Stored Procedure inside oracle 8.1.7.
    My feeling is, since the Java Stored Procedure wont be running from the command prompt (i will be actually invoking it through a Oracle trigger), it may be able to invoke the command prompt and run the java class i want. and that java class has to run with the SUn's Java, not Oracle JAva.
    Does any one have any idea about it?
    Has anyone ever invoked a java class or JAR file in command prompt from another Java Programme?
    YOur help will be highly appreciated.
    (P:S- Right now, my database is being upgraded, so i havent actually been able to create a Java Stored procedure and test it. But i have tested from a normal java programme running in command prompt and also from Visual Cafe).
    Thanks in advance.
    -- Subhasree.

    Hello Hari,
    Thanks for your quick reply.
    Can you please elaborate a little more on exactly how you did? may be just copy an dpaste taht part of teh code here?
    Thanks a lot in advance.
    --Subhasree                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to write call specs for a java stored procedure that takes a nested obj

    Example Class :
    public class B {
    int number;
    String str;
    public class A {
    private B[] _childern;
    public B[] getChildern(){
    return _children
    public static void saveAll(A a) throws SQLException {
    B[] children = a.getChildern();
    for(int i=0; i<children.length; i++){
    saveChild(children);
    public static void saveChild(B ch)throws SQLException {
    // do something
    What would be the call specification for the method A.saveAll(A)? Your help will be apprecited.
    Thank you
    Ajmal

    In other words, How to pass a Java Object from a Java stored procedure to a Java client ???
    Hello,
    I don't know to deal with a Vector object that has been generated from a stored procedure.
    Should I create first in the JDBC client and pass it as argument to the procedure ?
    Thanks in advance. Here is an extract ...
    On the client side :
    <<
    Vector buffer = new Vector();
    CallableStatement call =
    con.prepareCall ("{call my_procedure_run (?, ?)}");
    call.registerOutParameter(2, java.sql.Types.JAVA_OBJECT );
    call.setString (1, "bla bla bla");
    call.setObject (2, buffer);
    call.execute ();
    buffer = (Vector)call.getObject (2);
    >On the Java stored procedure
    <<
    public class my_procedure
    public static void Run(String input_value, Vector buffer)
    // ??? Vector buffer = new Vector();
    try
    while ( true )
    buffer.addElement(...) ;
    catch(Exception ex) { }

  • How to open external files in a Java stored procedure?

    Hi y'all,
    I'm trying to open an external text file from a Java stored procedure. The java sp has been successfully loaded, resolved, published, etc. in Oracle. I'm using the following statement to try to open the file (enclosed in a try/catch block):
    BufferedReader fileObj = new BufferedReader(new FileReader("fileName.txt"));
    I'm getting a file not found error. Where is Oracle looking (i.e., what directory)?
    Your help is greatly appreciated,
    Gary

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Gary Nool ([email protected]):
    Hi y'all,
    I'm trying to open an external text file from a Java stored procedure. The java sp has been successfully loaded, resolved, published, etc. in Oracle. I'm using the following statement to try to open the file (enclosed in a try/catch block):
    BufferedReader fileObj = new BufferedReader(new FileReader("fileName.txt"));
    I'm getting a file not found error. Where is Oracle looking (i.e., what directory)?
    Your help is greatly appreciated,
    Gary<HR></BLOCKQUOTE>
    Hi Gary,
    you must use a "database directory", e.g:
    SQL>create directory WORKING_DIR as '/home2/common/';
    SQL> select * from all_directories;
    OWNER DIRECTORY_NAME
    DIRECTORY_PATH
    SYS WORKING_DIR
    /home2/common/
    Gert

  • How to use Bpel output as input in stored procedure

    I am a SOA beginner. The scenario is to use the output from a BPEL process in a stored procedure as input and validate it against the data in the database. The data received from BPEL is compared with fields from different tables.
    It is basically a business process data validation.
    Will the output of BPEL be a Xml file and how it can b used in query of a procedure?
    Edited by: 869091 on Jun 29, 2011 12:14 AM

    The output from the BPEL process will be in XML format.
    Your requirement is not clear, please state it properly what are you trying to do.
    -Yatan

  • How to use equals in loop of an Stored Procedure

    Hi ,
    This is my Stored Procedure which is working fine (mean displaying all the Data from the Table)
    Here i want to add this functionality that is i want to check if there is 'IND' in country_code , i want to throw an Exception manually .
    I am struck up here : After the cursor fetches all the country_code in its loop , how can i check the whether country_code contains 'IND' or not in it ??
    create or replace PROCEDURE Auto_After_Bod_Status
    is
    country_code    VARCHAR2(40);
    myException EXCEPTION ;
    CURSOR PD1
    IS
    SELECT COUNTRY_CODE FROM LINK_STATUS;
    BEGIN
    OPEN PD1;
    LOOP
    FETCH PD1 INTO country_code;
    DBMS_OUTPUT.PUT_LINE(country_code);
    EXIT WHEN PD1%NOTFOUND;
    END LOOP;
    CLOSE PD1;
    END  Auto_After_Bod_Status;
    please help .Thanks .

    user10503747 wrote:
    I am struck up here : After the cursor fetches all the country_code in its loop , how can i check the whether country_code contains 'IND' or not in it ??Why do you need to check it after the loop. Check as soon as row is fetched. Also, your DBMS_OUTPUT.PUT_LINE(country_code); should be after EXIT WHEN PD1%NOTFOUND; not before:
    create or replace PROCEDURE Auto_After_Bod_Status
    is
    country_code VARCHAR2(40);
    myException EXCEPTION ;
    CURSOR PD1
    IS
    SELECT COUNTRY_CODE FROM LINK_STATUS;
    BEGIN
    OPEN PD1;
    LOOP
    FETCH PD1 INTO country_code;
    EXIT WHEN PD1%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(country_code);
    IF country_code LIKE '%IND%'
      THEN close pd1;
           raise myException;
    END IF;
    END LOOP;
    CLOSE PD1;
    END Auto_After_Bod_Status;But if you want to fetch all rows first:
    create or replace PROCEDURE Auto_After_Bod_Status
    is
    country_code VARCHAR2(40);
    ind number := 0;
    myException EXCEPTION ;
    CURSOR PD1
    IS
    SELECT COUNTRY_CODE FROM LINK_STATUS;
    BEGIN
    OPEN PD1;
    LOOP
    FETCH PD1 INTO country_code;
    EXIT WHEN PD1%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(country_code);
    IF country_code LIKE '%IND%'
      THEN ind := 1;
    END IF;
    END LOOP;
    CLOSE PD1;
    IF ind = 1
      THEN raise myException;
    END IF;
    END Auto_After_Bod_Status;SY.

  • How to use lexical parameters with Sql Server Stored Procedure?

    Hi,
    I'm developing a BI Publisher report on a sql server database. I need to execute a stored procedure to dynamically build the query by replacing the lexical parameters with the values of varaibles of the stored procedure. With Oracle stored procedures, I have used data template and had reference the varaiable in SP by prefixing it with '&'.
    It doesn't work if I try to do the same thing with SQL server. Is there anyone who has come across the similar situation? Please let me know if anyone has got any ideas...
    Thanks in Advance
    Rag

    TopLink currently doesn't support multiple ResultSets. Multiple ResultSets support is considered for a future release.

  • Using a OracleOCIConnection object in a Java Stored Procedure

    Hi,
    I'm trying to use a OracleOCIConnection in a Java Stored Procedure, but the JVM seems to be 1.3, so it doesn't support this object, how can I update the JVM to 1.4 or just load the necessary classes? I tried to load the ojdbc14.jar to the system's schema but the user needs a LoadClassInPackage permission, and I confess it scared me..

    Were u I look for the ofg---.pll.
    I can't find it my system
    --kalpana                                                                                                                                                                                       

  • Java Stored Procedure SAXParser XML Schema Validation

    Using Oracle XML Developers Kit 10.2.0.2.0 - Production.
    Attempting to validate using XML Schema in a Java stored procedure with the code:
                   if ( schemaDoc == null )
                        // Obtain default connection
                        Connection conn = new OracleDriver().defaultConnection();
                        OraclePreparedStatement stmt = (OraclePreparedStatement) conn.prepareStatement("SELECT XmlDocObj FROM XmlDoc WHERE XmlDocNbr = 2");
                        OracleResultSet rset = (OracleResultSet)stmt.executeQuery();
                        if ( rset.next() )
                             // get the XMLType
                             XMLType schemaXml = (XMLType)rset.getObject(1);
                             XSDBuilder builder = new XSDBuilder();
                             XMLSchema schemaDoc = (XMLSchema)builder.build(new InputSource(schemaXml.getInputStream()));
                   if ( inst == null )
                        inst = new ValidateCoreRequest();
                   ErrorHandlerImpl handler = inst.getNewErrorHandler();
    SAXParser saxParser = new SAXParser();
    saxParser.setXMLSchema(schemaDoc);
    saxParser.setValidationMode(XMLParser.SCHEMA_VALIDATION);
    saxParser.setErrorHandler(handler);
    saxParser.parse(new InputSource(new StringReader(docStr)));
    if( handler.validationError )
                        errorMsg[0] = handler.saxParseException.getMessage().substring(0, Math.min(199, handler.saxParseException.getMessage().length()));
    Never reports validation errors in the XML. Although the XDK Programmers Guide states "...you can use
    the oracle.xml.parser.schema.XSDBuilder class to build an XML schema and
    then configure the parser to use it by invoking the XMLParser.setXMLSchema()
    method. In this case, the XML parser automatically sets the validation mode to
    SCHEMA_STRICT_VALIDATION and ignores the schemaLocation and
    noNamespaceSchemaLocation attributes." No validation seems to occur. I have tried to set an xsi:noNamespaceSchemaLocation attribute on the root XML node, but this results in URL errors if the URL is not valid or schema build errors if the URL is valid, but does not point to a real location.
    It appears that without a schema location attribute, no schema validation occurs. Using setXMLSchema() with a database source does not seem to cause the schema location attributes to be ignored. At least for Java stored procedures.
    Does XML Schema validation work in the database for externally referenced schemas?
    Thank You,
    Art

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Jan Vissers ([email protected]):
    I have two schemas A and B. A contains a java stored procedure which calls a java stored procedure stored in B. Upon resolving the "A" Java Stored Procedures I get the following error:
    ORA-29545: badly formed class: at offset 3093 of Adapter.TFADPBeschikbaarheid.sendAanvraag expecting a class-oracle.xml.parser.v2.XMLDocument but encountered a class-oracle.xml.parser.v2.XMLDocument.
    ... Question:
    it is expecting something which it has in fact encountered... SO!!!! What is the error.
    Thx,
    Jan<HR></BLOCKQUOTE>
    Try this:
    Edit your XSU installation script located on lib directory of Oracle XSU's distribution:
    Find the line:
    loadjava -r -v -u $USER_PASSWORD xmlparserv2.jar
    Replace by:
    loadjava -r -v -g public -u $USER_PASSWORD xmlparserv2.jar
    And installs your Oracle XSU again.
    Best regards, Marcelo.

  • View Java Stored Procedures

    Hello,
    How can I find the names of Java stored procedures
    created in the database and what are the published
    stored procedures?
    thanks
    Ranganath Samudrala

    Hi,
    There are two meta catalogs "okJavaObj" and "okJavaMember" that can be used to get all sorts of information for Java classes and Java methods. Some SQL commands are as follows:
    To see all Java classes stored in the database, type in the following select statement:
    select "Schema", "Name" from "okJavaObj" ;
    or you may want to create the following view:
    drop public synonym all_javaobjects;
    create or replace view all_javaobjects( Schema, Name, SuperClass, Type) as
    (select "Schema", "Name", "SuperClass", "Type" from "okJavaObj");
    grant select on all_javaobjects to public;
    create public synonym all_javaobjects for system.all_javaobjects;
    commit;
    You may want to create the following view to see classnames and methods
    drop public synonym all_methods;
    create or replace view all_methods
    (schema,classname, superclass, declaringclass, method_name, type, argcount, jnisignature) as
    select a."Schema", a."Name" as ClassName, a."SuperClass",
    b."DeclaringClass" , b."Name" as method_name , b."Type",
    b."ArgCount", b."JNISign" as jnisignature
    from "okJavaObj" a, "okJavaMember" b
    where a.POL_REF = b."DefinedIn";
    grant select on all_methods to public;
    create public synonym all_methods for system.all_methods;
    commit;

  • Sending mail in a Java Stored Procedure

    Question: What is the best way to have a Java Stored Procedure connect to our mailhost and send an email? I have been trying to use URL and URLConnection, but I found out URL somehow does not support the "mailto" protocol in the Java Stored Procedure. Funny enough the "mailto" protocol is definetely supported by URL when I test it in the JDK virtual machine.
    Maybe this is the reason: I read in the 8i docs that the 8i Virtual Machine is only JDK1.1.6 compliant.
    Unfortunately I can't find the 1.1.6 docs anywhere. So I cannot do any research on what protocals are supported in JDK1.1.6 .
    Conclusion: Is it possible to send an email in a Java Stored Procedure, and how?
    Thanks in advance :-) Johan

    The Java mail API was a set of extension libraries for the 1.1 JDK. I have heard of folks who succeeded in loading these intot he database and then using them from within a Java stored procedure.

  • Java Stored Procedure calling HTTP Servlet in Weblogic

    I am currently working on an e-commerce application for a brick-n-mortar electronics store. The store currently has an Oracle database that contains all of the products the store sells. The e-commerce site will have a separate Oracle database. Both database are Oracle 9i release 2 databases. The e-commerce site will be using BEA's Weblogic as its application server. I need to move data from the store db into the e-commerce db. The actual moving of the data is not the issue. The issue comes from needing to call several methods on a Stateless Session EJB, loaded on the Weblogic server, to perform backend processing. I wanted to make a JNDI call from a Java Stored Procedure but with Release 2, this option is no longer supported. The release notes (http://otn.oracle.com/tech/java/htdocs/9idb2_java.html) indicated that the JVM now supports calling out to Servlets using HTTP Client from a Java Stored Procedure.
    Has anyone done this? Is there any sample code available?
    Thanks for any help.

    I am currently working on an e-commerce application for a brick-n-mortar electronics store. The store currently has an Oracle database that contains all of the products the store sells. The e-commerce site will have a separate Oracle database. Both database are Oracle 9i release 2 databases. The e-commerce site will be using BEA's Weblogic as its application server. I need to move data from the store db into the e-commerce db. The actual moving of the data is not the issue. The issue comes from needing to call several methods on a Stateless Session EJB, loaded on the Weblogic server, to perform backend processing. I wanted to make a JNDI call from a Java Stored Procedure but with Release 2, this option is no longer supported. The release notes (http://otn.oracle.com/tech/java/htdocs/9idb2_java.html) indicated that the JVM now supports calling out to Servlets using HTTP Client from a Java Stored Procedure.
    Has anyone done this? Is there any sample code available?
    Thanks for any help. Hi,
    sorry we have not yet formally documented this but here is a code snippet
    Kuassi
    /* HttpCallout - simple test to callout to static pages from Java Stored
    Procedures */
    import java.io.IOException;
    import java.io.InputStream;
    import HTTPClient.HTTPConnection;
    import HTTPClient.HTTPResponse;
    import HTTPClient.AuthorizationInfo;
    public class HttpCallout {
    public static void main(String[] argv) throws InterruptedException {
    HttpCallout t = new HttpCallout(argv);
    t.run();
    private String[] argv ;
    HttpCallout(String[] argv) {
    this.argv = argv;
    void initSSL() {
    public void run() {
    try {
    if ( argv.length == 0 ) {
    System.out.println("HttpCallout " +
    "protocol " +
    "host " +
    "port " +
    "page ");
    return;
    // process arguments
    int argc = 0;
    String protocol = argv[argc++];
    String host = argv[argc++];
    int port = Integer.parseInt(argv[argc++]);
    String page = argv[argc++];
    // Debugging - don't set for now
    // System.setProperty("HTTPClient.log.mask", "3");
    // noop
    initSSL();
    // Grab HTTPConnection
    HTTPConnection con = new HTTPConnection(protocol, host, port);
    con.setTimeout(20000);
    con.setAllowUserInteraction(false);
    // Grab Response
    HTTPResponse rsp = con.Get(page);
    byte[] data = rsp.getData();
    if ( data == null ) {
    System.out.println("no data");
    } else {
    System.out.println("data length " + data.length);
    System.out.println(new String(data));
    catch ( Throwable ex ) {
    ex.printStackTrace();

  • How to deploy signed jars/classes in Java Stored Procedure

    I am using java encryption API in my java application that I want to deploy as java stored procedure. The API is kept in the signed jar files.
    The Application is running in the MS-DOS environment but not in Oracle8i.
    It gives me following error.
    java.lang.ExceptionInInitializerError: java.lang.SecurityException: Cannot set
    up certs for trusted CAs
    at javax.crypto.b.<clinit>([DashoPro-V1.2-120198])
    at javax.crypto.KeyGenerator.getInstance([DashoPro-V1.2-120198])
    at DesKey.GenerateKey(DesKey.java:63)
    declare
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.ExceptionInInitializerError
    ORA-06512: at line 4
    (Note: I have enabled the java output in SQL Plus editor otherwise it will give only the second part of error that starts from ERROR at line 1:)
    please guide me how to solve this problem.
    Salman Hameed
    null

    Salman,
    If you do not get a reply on this forum, I recommend you post this question on the Oracle JVM discussion forum as well.
    In addition, I would recommend checking the documentation for Oracle8i. The Oracle8i Java Developer's Guide, the Java Stored Procedures Guide, and the JDBC Developer's guide may have some information on this topic. You can get to this doc from the OTN Documentation page. Click on Oracle8i, then General Documentation, Release 2 (8.1.6), then scroll down to see the link for the Oracle8i Java Developer's documetation. All of the books mentioned above are available from that link.

  • How to use the External Jars

    Hi All,
    I want to use the Api for java advanced imaging,
    and i don't know where to place that jar and how to use the classes from that to do the related programming.
    Please help.
    Thanks
    Mahesh.

    any jar that's on your classpath you can use.
    For information on how to use the classes in a specific library your best friend is the documentation about that library.
    To have your editor/IDE know about a library, see the documentation for that editor/IDE.

  • How to use the TCP/IP in Java?Thanks!

    How to use the TCP/IP in Java?Thanks!

    Look at the java.net package, more specifically to classes ServerSocket (The server TPC conection) and Socket (the client TCP conection)
    Abraham

Maybe you are looking for

  • How to delete the list servers in the login essbase?

    Is there any way to delete the list of essbase servers from checkbox in the essbase login dialog ?I want that the checbox is empty, because there is too many serves now ... how can i do it ?

  • What is the best secondary display for my mbp 2015 13"

    I am searching for a cheaper solution than the thunderbolt display for my new MBP 2015 13".  I would like to get a display that is not difficult to calibrate and works seamlessly with mac products.  Any ideas would be greatly appreciated. 

  • Photosmart C410 not printing black

    My printer suddenly stopped printing black. I have changed both the photo black and the black cartridges but hasn't helped. Any suggestions?

  • Problem with Canvas component.

    Hello all, I am building a sort of flowcharting software using Swing. The software is standalone. The "flowcharting" component is a sort of canvas, However it does not extend the Canvas class from AWT, but rather extends a JComponent. The paint() met

  • Speed grade not rendering

    So i have tried every file format i could think of to render out my speed grade project and no matter what i try (compressed by h.264 or non compressed, to pro res 422) the video is either corupt or the colour work does not end up in the final movie.