Running a Corba Client as a Java Stored Procedure

Hi,
I�m trying to use a Java Stored Procedure running as a Corba Client. I want to use the built in Visibroker ORB on Oracle side and JacORB (or others) on the server side.
How can I init the ORB and get a naming service running not in Oracle but on the server side? Also which jar�s do I need to load into the db with (loadjava) to run the visibroker orb inside the Java Stored Procedure Client?
I�m using Oracle 8.1.7.
Thanks for help ;)

By the way I�m using ORACLE 8.1.7.

Similar Messages

  • Using XMLType in a Java Stored Procedure

    I have the following piece of java test code that attempts to read an XMLType object from the database. When I run this client side, using either the oci or thin driver it works fine. When I run the same code as a java stored procedure I get the exception shown below.
    (The problem was first seen on 9.2.0.3/Win2K. Ive patched to 9.2.0.4 and am still getting the same error)
    Can anybody please help?
    Thanks
    Java Test Code:
    ===============
    import java.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.*;
    import oracle.xdb.*;
    public class Test {
    public static void main(String[] args) throws Exception {
    System.out.println(run());
    public static String run() throws Exception {
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    // client side THICK
    //Connection conn = DriverManager.getConnection("jdbc:oracle:oci8:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID=ORACLE)))", "scott", "tiger");
    // client side THIN
    //Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:ORACLE", "scott", "tiger");
    // server side
    Connection conn = DriverManager.getConnection("jdbc:default:connection");
    OracleCallableStatement stmt = (OracleCallableStatement)conn.prepareCall("{? = call XDBUriType('/test.xml').getXML()}");
    stmt.registerOutParameter (1, OracleTypes.OPAQUE,"SYS.XMLTYPE");
    stmt.execute();
    XMLType xml = XMLType.createXML(stmt.getOPAQUE(1));
    return xml.getStringVal();
    SQLPLUS TRACE:
    ==============
    SQL> VARIABLE res VARCHAR2(4000);
    SQL> call run() into :res;
    call run() into :res
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.Exception: Unimplemented Feature
    Dump File:
    ==========
    Dump file c:\oracle9i\admin\oracle\udump\oracle_ora_4964.trc
    Fri Oct 24 12:04:30 2003
    ORACLE V9.2.0.3.0 - Production vsnsta=0
    vsnsql=12 vsnxtr=3
    Windows 2000 Version 5.0 Service Pack 4, CPU type 586
    Personal Oracle9i Release 9.2.0.3.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.3.0 - Production
    Windows 2000 Version 5.0 Service Pack 4, CPU type 586
    Instance name: oracle
    Redo thread mounted by this instance: 1
    Oracle process number: 12
    Windows thread id: 4964, image: ORACLE.EXE
    *** 2003-10-24 12:04:30.000
    *** SESSION ID:(10.121) 2003-10-24 12:04:30.000
    java.lang.Exception: Unimplemented Feature
    at oracle.xdb.spi.XDBContext.getServerEnv(XDBContext.java)
    at oracle.xdb.XMLType.initConn(XMLType.java:1874)
    at oracle.xdb.XMLType.<init>(XMLType.java:846)
    at oracle.xdb.XMLType.createXML(XMLType.java:469)
    at cms.Test.run(Test.java:27)

    I have the very same problem. Somebody from Oracle Corp please reply. If this is a bug, please do not let us waste time to research a solution. Otherwise, point a way out!
    Thanks,

  • Accessing XMLType in a Java Stored Procedure

    I have the following piece of java test code that attempts to read an XMLType object from the database. When I run this client side, using either the oci or thin driver it works fine. When I run the same code as a java stored procedure I get the exception shown below.
    (My system is 9.2.0.3 on Win2k)
    Can anybody help?
    Thanks
    Java Test Code:
    ===============
    import java.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.*;
    import oracle.xdb.*;
    public class Test {
    public static void main(String[] args) throws Exception {
    System.out.println(run());
    public static String run() throws Exception {
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    // client side THICK
    //Connection conn = DriverManager.getConnection("jdbc:oracle:oci8:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID=ORACLE)))", "scott", "tiger");
    // client side THIN
    //Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:ORACLE", "scott", "tiger");
    // server side
    Connection conn = DriverManager.getConnection("jdbc:default:connection");
    OracleCallableStatement stmt = (OracleCallableStatement)conn.prepareCall("{? = call XDBUriType('/test.xml').getXML()}");
    stmt.registerOutParameter (1, OracleTypes.OPAQUE,"SYS.XMLTYPE");
    stmt.execute();
    XMLType xml = XMLType.createXML(stmt.getOPAQUE(1));
    return xml.getStringVal();
    SQLPLUS TRACE:
    ==============
    SQL> VARIABLE res VARCHAR2(4000);
    SQL> call run() into :res;
    call run() into :res
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.Exception: Unimplemented Feature
    Dump File:
    ==========
    Dump file c:\oracle9i\admin\oracle\udump\oracle_ora_4964.trc
    Fri Oct 24 12:04:30 2003
    ORACLE V9.2.0.3.0 - Production vsnsta=0
    vsnsql=12 vsnxtr=3
    Windows 2000 Version 5.0 Service Pack 4, CPU type 586
    Personal Oracle9i Release 9.2.0.3.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.3.0 - Production
    Windows 2000 Version 5.0 Service Pack 4, CPU type 586
    Instance name: oracle
    Redo thread mounted by this instance: 1
    Oracle process number: 12
    Windows thread id: 4964, image: ORACLE.EXE
    *** 2003-10-24 12:04:30.000
    *** SESSION ID:(10.121) 2003-10-24 12:04:30.000
    java.lang.Exception: Unimplemented Feature
    at oracle.xdb.spi.XDBContext.getServerEnv(XDBContext.java)
    at oracle.xdb.XMLType.initConn(XMLType.java:1874)
    at oracle.xdb.XMLType.<init>(XMLType.java:846)
    at oracle.xdb.XMLType.createXML(XMLType.java:469)
    at cms.Test.run(Test.java:27)

    I have the very same problem. Somebody from Oracle Corp please reply. If this is a bug, please do not let us waste time to research a solution. Otherwise, point a way out!
    Thanks,

  • 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();

  • Java Stored Procedure / connection JDBC / Server Side / Client Side

    Hi,
    I would like to know if we can know at the runtime with a JDBC api if the stored procedure is running in client side or in server side ?
    THANKS

    You wrote
    "Java stored procedures -- by definition - are stored in the 8i rdbms. !!"
    From the Oracle8i Java Stored Procedures Developer's Guide
    Release 8.1.5
    A64686-01
    "If you create Java class files on the client side, you can use loadjava to upload them into the RDBMS. Alternatively, you can upload Java source files and let the Aurora JVM compile them. In most cases, it is best to compile and debug programs on the client side, then upload the class files for final testing within the RDBMS"
    This means that you can create shared classes that are used on both the client and server side. The source does not need to reside within the server (according to their documentation). Please also note the following from the Oracle8i JDBC Developer's Guide and Reference Release 8.1.5 A64685-01 for using the getConnection() method on the server:
    "If you connect to the database with the DriverManager.getConnection() method, then use the connect string jdbc:oracle:kprb:. For example:
    DriverManager.getConnection("jdbc:oracle:kprb:");
    Note that you could include a user name and password in the string, but because you are connecting from the server, they would be ignored."
    So if you're coding a shared class that is to run on both the client and server side, you might do something like this:
    Connection conn =
    DriverManager.getConnection(
    System.getProperty("oracle.server.version") == null
    ? "jdbc:oracle:thin:@hostname:1521:ORCL"
    : "jdbc:oracle:kprb:"),
    "youruserid","yourpassword");
    As stated earlier, the userid and password are supposedly ignored for server connections retrieved in this manner. I haven't tried this yet, but it is documented by Oracle.
    Regards,
    Steve
    null

  • Java Stored Procedure / Server Side / Client Side / connection

    Hi,
    I would like to know if we can know at the runtime with a JDBC api if the stored procedure is running in client side or in server side ?
    THANKS

    You wrote
    "Java stored procedures -- by definition - are stored in the 8i rdbms. !!"
    From the Oracle8i Java Stored Procedures Developer's Guide
    Release 8.1.5
    A64686-01
    "If you create Java class files on the client side, you can use loadjava to upload them into the RDBMS. Alternatively, you can upload Java source files and let the Aurora JVM compile them. In most cases, it is best to compile and debug programs on the client side, then upload the class files for final testing within the RDBMS"
    This means that you can create shared classes that are used on both the client and server side. The source does not need to reside within the server (according to their documentation). Please also note the following from the Oracle8i JDBC Developer's Guide and Reference Release 8.1.5 A64685-01 for using the getConnection() method on the server:
    "If you connect to the database with the DriverManager.getConnection() method, then use the connect string jdbc:oracle:kprb:. For example:
    DriverManager.getConnection("jdbc:oracle:kprb:");
    Note that you could include a user name and password in the string, but because you are connecting from the server, they would be ignored."
    So if you're coding a shared class that is to run on both the client and server side, you might do something like this:
    Connection conn =
    DriverManager.getConnection(
    System.getProperty("oracle.server.version") == null
    ? "jdbc:oracle:thin:@hostname:1521:ORCL"
    : "jdbc:oracle:kprb:"),
    "youruserid","yourpassword");
    As stated earlier, the userid and password are supposedly ignored for server connections retrieved in this manner. I haven't tried this yet, but it is documented by Oracle.
    Regards,
    Steve
    null

  • 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

  • NameFromLastDDL Error during java stored procedure upload...

    Hi guys,
    I am trying to upload a class to send email within a java stored procedure.
    JDeveloper fails to upload the class, and the error message doesn't help me:
    I guess the automatically generated SQL statment features a "NameFromLastDDL" argument, but i have no control over that....anybody had this issue before ?
    Following, the "ugly" exception:
    Error while creating class client/Utils
    ORA-06550: line 1, column 91:
    PLS-00201: identifier 'NameFromLastDDL' must be declared
    ORA-06550: line 1, column 85:
    PL/SQL: Statement ignored
    java.sql.SQLException: ORA-06550: line 1, column 91:
    PLS-00201: identifier 'NameFromLastDDL' must be declared
    ORA-06550: line 1, column 85:
    PL/SQL: Statement ignored
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
         at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:184)
         at oracle.jdbc.driver.T4CCallableStatement.execute_for_rows(T4CCallableStatement.java:873)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1086)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2984)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3076)
         at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4273)
         at oracle.aurora.server.tools.loadjava.ClientClassObject.create(ClientClassObject.java:68)
         at oracle.aurora.server.tools.loadjava.SchemaObject.process1(SchemaObject.java:223)
         at oracle.aurora.server.tools.loadjava.LoadJava.add(LoadJava.java:530)
         at oracle.aurora.server.tools.loadjava.LoadJava.addClass(LoadJava.java:584)
         at oracle.aurora.server.tools.loadjava.LoadJava.add(LoadJava.java:434)
         at oracle.aurora.server.tools.loadjava.LoadJava.add(LoadJava.java:378)
         at oracle.aurora.server.tools.loadjava.LoadJava.addJar(LoadJava.java:717)
         at oracle.aurora.server.tools.loadjava.LoadJava.add(LoadJava.java:430)
         at oracle.aurora.server.tools.loadjava.LoadJava.add(LoadJava.java:378)
         at oracle.aurora.server.tools.loadjava.LoadJava.add(LoadJava.java:347)
         at oracle.aurora.server.tools.loadjava.LoadJava.add(LoadJava.java:643)
         at oracle.aurora.server.tools.loadjava.LoadJava.processDeferredFiles(LoadJava.java:615)
         at oracle.aurora.server.tools.loadjava.LoadJava.process(LoadJava.java:806)
         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:473)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:360)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeployToMostRecent(StoredProcHandler.java:256)
         at oracle.jdevimpl.deploy.StoredProcProfileDt$2.run(StoredProcProfileDt.java:193)
    The following operations failed
    class client/Utils: creation (createFailed)
    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:473)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:360)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeployToMostRecent(StoredProcHandler.java:256)
         at oracle.jdevimpl.deploy.StoredProcProfileDt$2.run(StoredProcProfileDt.java:193)

    I think u dont've previleges to run
    the procedure.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by arunr12:
    hi I am calling java stored procedure from jdbc. i am getting wierd exceptions:
    CallableStatement cstmt = conn.prepareCall("begin SEND_MAIL(?,?,?);end;");
    cstmt.setString(1,"[email protected]");
    cstmt.setString(2,"Mail from Stored Proc");
    cstmt.setString(3,"This is test mail from Oracle8i");
    cstmt.execute();
    i am getting following Exception:
    java.sql.SQLException: ORA-29532: Java call terminated by uncaught Java exception: java.security.AccessControlException: the Permission (java.util.PropertyPermission * read,write) has not been granted by dbms_java.grant_permission to SchemaProtectionDomain(ISTORE_CUST|PolicyTableProxy(ISTORE_CUST))
    ORA-06512: at "ISTORE_CUST.SEND_MAIL", line 0
    ORA-06512: at line 1
    <HR></BLOCKQUOTE>
    null

  • Java Stored Procedure using XSU on 9i Lite

    I have create Java Stored Procedure using XML SQL Utility to return results in XML format. I have tested the stored procedure on the development machine (with SDK and Webtogo)without any problem. When I tested it on the client machine (with only the lite database for Window download from the webtogo server as part of the setup), there's an error [POL-8035] no such attribute or method when I call the procedure through MSQL. However, after calling the stored procedure the 3rd times, it will return the results in XML. Once I logout after that, I will have to call the same SP 3 times (always 3 times) before I get the results.
    I'm running on Win2000, Oracle lite 5.0.1. with jdk 1.3.1 - same for the development machine.
    I'm using the same xsu12.jar file.
    What did I miss?

    Nothing?
    No one? No ideias?
    Regards,
    Flavio Matiello

  • Java Stored Procedures + oralce.xdb.XMLType + initxdbj.sql

    In order to use XMLType object in java stored procedures, I need to import oralce.xdb.XMLType package. I got compiler error saying "Class oracle.xdb.XMLType not found" (See List1).
    I check my installed package, sure enough these is no "oracle/xdb/XMLType" or any xdb related one. (See list2) This surprises me since my 9i/Solaris installation was successful and spotless one.
    The 9i App Dev - XML doc states that script $ORACLE_HOME/rdbms/admin/initxdbj.sql could install that package. (See List3) The fact is no way this script could be found from Oracle901/Solaris8 or Oracle901/NT installations.
    If java program moved to client and included xdb_g.jar in CLASSPATH, then it is fine as Doc declares. It just failed to compile in server as stored procedures.
    Please help, Thanks.
    Andy Ting DBA (301)240-2223, [email protected]

    (now include Listings)
    In order to use XMLType object in java stored procedures, I need to import oralce.xdb.XMLType package. I got compiler error saying "Class oracle.xdb.XMLType not found" (See List1).
    I check my installed package, sure enough these is no "oracle/xdb/XMLType" or any xdb related one. (See list2) This surprises me since my 9i/Solaris installation was successful and spotless one.
    The 9i App Dev - XML doc states that script $ORACLE_HOME/rdbms/admin/initxdbj.sql could install that package. (See List3) The fact is no way this script could be found from Oracle901/Solaris8 or Oracle901/NT installations.
    If java program moved to client and included xdb_g.jar in CLASSPATH, then it is fine as Doc declares. It just failed to compile in server as stored procedures.
    Please help, Thanks.
    Andy Ting DBA (301)240-2223, [email protected]
    ====================================================================
    List 1:
    sql> select NAME,TYPE,SEQUENCE,LINE,substr(text,1,80) TEXT from user_errors order BY 1,2,3,4
    NAME TYPE SEQUENCE LINE
    TEXT
    proto4a/database/XMLTypeTest JAVA CLASS 1 0
    ORA-29535: source requires recompilation
    proto4a/database/XMLTypeTest JAVA SOURCE 1 0
    proto4a/database/XMLTypeTest:11: Class oracle.xdb.XMLType not found in import.
    proto4a/database/XMLTypeTest JAVA SOURCE 2 0
    proto4a/database/XMLTypeTest:12: Class XMLTYPE not found in import.
    proto4a/database/XMLTypeTest JAVA SOURCE 3 0
    Info: 2 errors
    ==============================================================
    List 2:
    sql> select OWNER,OBJECT_NAME,OBJECT_TYPE from all_objects
    where upper(object_name) like '%XMLTYPE%';
    OWNER OBJECT_NAME OBJECT_TYP
    SYS /219cdace_AQxmlTypeInfoRespons JAVA CLASS
    /a341e963_AQxmlTypeInfoRequest
    XMLTYPE TYPE
    XMLTYPE TYPE BODY
    XMLTYPE_LIB LIBRARY
    PUBLIC /219cdace_AQxmlTypeInfoRespons SYNONYM
    /a341e963_AQxmlTypeInfoRequest
    sql> select OWNER,OBJECT_NAME,OBJECT_TYPE from all_objects
    where upper(object_name) like '%XDB%';
    no rows selected
    ====================================================================
    List 3:
    Installing and using oracle.xdb.XMLType class
    The oracle.xdb.XMLType is available in the xdb_g.jar file in the ORACLE_
    HOME/rdbms/jlib where ORACLE_HOME refers to the Oracle home directory.
    Using oracle.xdb.XMLType inside JServer:
    This class is pre-loaded in to the JServer and is available in the SYS schema.
    It is not loaded however, if you have upgraded your database from an earlier
    version. If you need to upload the class into the JServer, you would need to run the
    initxdbj.sql file located in the ORACLE_HOME/rdbms/admin directory, while
    connected as SYS.
    Using oracle.xdb.XMLType on the client:
    If you need to use the oracle.xdb.XMLType class on the client side, then ensure that
    the xdb_g.jar file is listed in your CLASSPATH environment variable.
    =====================================================================

  • APEX fails with Java stored procedure that creates a JDBC connection

    Hello!
    We are facing a strange problem since we have upgraded from Oracle 10g and Apache to Oracle 11g with Embedded Gateway.
    Here is what we do:
    ** APEXX calls a PL/SQL package function "OPEN_CONNECTION" that wraps a Java stored procedure called "openConnection".*
    FILE_READER_REMOTE_API.openConnection(user, password, host, port, service);
    ** The Java stored procedures "openConnection" opens a JDBC connection to an other database:*
    public class FileReaderRemote {
    private static Connection conn = null;
    private static DefaultContext remoteContext = null;
    public static void openConnection(String user, String password, String host, String port, String service) throws SQLException {
    // Load the Oracle JDBC driver
    DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    java.util.Properties props = new java.util.Properties();
    props.put ("user", user);
    props.put ("password", password);
    //props.put ("database", "//" + host + ":" + port + "/" + service);
    props.put ("database", host + ":" + port + ":" + service);
    props.put("v$session.program", "FileReaderRemote2");
    // Connect to the database
    remoteContext = Oracle.getConnection("jdbc:oracle:thin:", props);
    This procedure used to work fine before the upgrade, but now we see the following:
    * It still works when called directly from TOAD or SQL*Plus, even under the user ANONYMOUS.
    * When called from APEX and the target database is Oracle 11g, it still works.
    * When called from APEX and the target database is Oracle 10g, it takes several minutes and we receive this error:
    *"Socket read timed out"*
    We have tested the following workaround:
    We have created a database link to our own database and called the stored procedure through that database link.
    FILE_READER_REMOTE_API.openConnection*@loopback*(user, password, host, port, service);
    This works, but is not really an option.
    I hope some one of you can explain this strange behaviour to me.
    Best regards,
    Matthias

    You wrote
    "Java stored procedures -- by definition - are stored in the 8i rdbms. !!"
    From the Oracle8i Java Stored Procedures Developer's Guide
    Release 8.1.5
    A64686-01
    "If you create Java class files on the client side, you can use loadjava to upload them into the RDBMS. Alternatively, you can upload Java source files and let the Aurora JVM compile them. In most cases, it is best to compile and debug programs on the client side, then upload the class files for final testing within the RDBMS"
    This means that you can create shared classes that are used on both the client and server side. The source does not need to reside within the server (according to their documentation). Please also note the following from the Oracle8i JDBC Developer's Guide and Reference Release 8.1.5 A64685-01 for using the getConnection() method on the server:
    "If you connect to the database with the DriverManager.getConnection() method, then use the connect string jdbc:oracle:kprb:. For example:
    DriverManager.getConnection("jdbc:oracle:kprb:");
    Note that you could include a user name and password in the string, but because you are connecting from the server, they would be ignored."
    So if you're coding a shared class that is to run on both the client and server side, you might do something like this:
    Connection conn =
    DriverManager.getConnection(
    System.getProperty("oracle.server.version") == null
    ? "jdbc:oracle:thin:@hostname:1521:ORCL"
    : "jdbc:oracle:kprb:"),
    "youruserid","yourpassword");
    As stated earlier, the userid and password are supposedly ignored for server connections retrieved in this manner. I haven't tried this yet, but it is documented by Oracle.
    Regards,
    Steve
    null

  • SQLJ and Java Stored Procedures

    Hi,
    Am very sorry, if I am taxing you too much with Java Stored Procedures!!
    However, I have struggling with it for more than 3 days or so.So please bear with me
    I am facing a peculiar problem on the subject.
    I have deployed a Java Stored Procedure using Connection name as "JDBC" through JDev.
    My client calls the Stored procedure getDept as follows:
    int deptNo = 0;
    String deptName = null,
    deptLoc = null;
    #sql {
    call sample.getDept( :out deptNo,
    :out deptName,
    :out deptLoc)
    In my project properties , in SQLJ tab, when I select "JDBC" as my connectionName, and leave the ContextName blank(i.e. DefaultContext), I get the following error :
    Error: [26] Not Found: SAMPLE.GETDEPT There is no stored procedure with this name
    When I leave the ConnectionName as blank (which I suppose means donot do online checking!!), it compiles OK.
    Howvever, it is not able to run my SQLJ file!!
    Cannot figure out why this is happening.Please help!!
    TIA
    Sandeep
    null

    Looks like Java stored procedure don't support the return of result sets to the client. Given the complexity and non-generic 'cursor ref' approach that Oracle has always implemented, I guess it is not too surprising. I suggest throwing the select into a work table and pulling the rows from there. If you are in a COM capable environment, you can use 0040 to get back a Dynaset, but be aware, it is live!
    Good luck.
    Cal

  • N-comp compilation of an Java Stored Procedure

    I am working on Oracle 9.2.0.2 Enterprise Server running on Windows 2000 Advanced Server SP3. I am trying to compile (N-comp) a Java Stored Procedure. It throws up quite a few errors. Normal deployment works fine.
    Oracle has acknowledged the error & provided a bug number. (Period)
    Is there a solution to this ? Has anyone attempted this with success on the environment mentioned above.
    Thanks..

    Thanks. One of the Oracle support staff told me it is a known bug.
    The bug number is 2453291
    "NCOMP DOES NOT WORK ON THE WINDOWS NT PLATFORM"
    While N-comp compilation of an Java Stored Procedure (SQLJ) am getting following errors :-
    softwares used
    Java ver :- JDK 1.3
    database :- oracle version 9.2 with JServer Rel 9.2.0.1.0
    Steps carried for Ncomp compilation
    1) sqlj -ser2class Ap_cm_am_exchange1.sqlj
    2) jar cvf ap_cm_am_exchange1.jar *.class
    3) dropjava -user host/[email protected] ap_cm_am_exchange1.jar
    4) loadjava -oci8 -resolve -force -user host/[email protected] ap_cm_am_exchange1.jar
    5) ncomp -user host/[email protected] -force ap_cm_am_exchange1.jar
    Also Pls find attached
    1) SQLJ code ( Ap_cm_am_exchange1.sqlj )
    2) complete error txt
    3) Ncomp log
    Errors
    error in: FindClassesToNcomp :java.sql.SQLException: ORA-29540: class oracle/jaccelerator/server/ap_cm_am_exchange1_minimalClassListAndTCDumper does not exist
    ORA-06512: at "DV58BOTEST2.JACCELERATOR___FIND_CLASS_LIST", line 0
    ORA-06512: at "DV58BOTEST2.JACCELERATOR_FIND_CLASS_LIST", line 1
    ORA-06512: at line 1
    java.sql.SQLException: ORA-29540: class oracle/jaccelerator/server/ap_cm_am_exchange1_minimalClassListAndTCDumper does not exist
    ORA-06512: at "DV58BOTEST2.JACCELERATOR___FIND_CLASS_LIST", line 0
    ORA-06512: at "DV58BOTEST2.JACCELERATOR_FIND_CLASS_LIST", line 1
    ORA-06512: at line 1
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java)
    at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java)
    at oracle.jdbc.oci8.OCIDBAccess.executeFetch(OCIDBAccess.java)
    at oracle.jdbc.oci8.OCIDBAccess.parseExecuteFetch(OCIDBAccess.java)
    at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java)
    at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java)
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java)
    at oracle.jaccelerator.client.FindClassesToNcomp.doit(FindClassesToNcomp.java:82)
    at oracle.jaccelerator.client.JDBCDriver.run(JDBCDriver.java:80)
    at oracle.jaccelerator.client.FindClassesToNcomp.main(FindClassesToNcomp.java:17)

  • 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) { }

  • Help with use of Java Stored Procedures to invoke Java Code within Applicat

    Good afternoon everyone
    Our development team is looking for some assistance/validation of a design strategy we are deploying for a client. Let me first layout the environment and then the design issue at hand:
    Business User Workstation component: Oracle SQL*Developer 1.5.x
    Reporting Tool: Actuate e.Spreadsheet A10
    Application Web UI: J2EE application developed with Eclipse
    Application Scripting: Application has a scripting component whereby business users can write Oracle PL/SQL to perform many of the functions that are available in the Web UI, but can be batched up or repeated several times.
    Application Server WebLogic 9.2.3 (client constraint)
    Database Serve: Oracle 11g, Release 11.1.0.7
    Lots of other stuff included but irrelevant for this conversation.
    Here's the scenario in question:
    1.     Through the scripting solution, the application user must use PL/SQL to invoke functionality within the Web UI. All PL/SQL that the application user creates does not contain any SQL. Instead our security model mandates that “pre-defined” routines will perform all of the SQL operations against the database; the application user simply invokes the stored procedures of functions to perform activities in the database.
    2.     There is a component of the scripting application that facilitates the creation of reports. In our application, we are using Actuate’s e.Spreadsheet Engine to create the report and format the report based on a template. The template is provided as input, as well as other data items, into Actuate for processing. The net result is the report is created by the Actuate e.Spreadsheet engine in pdf format and then sent back to the user for distribution to other users in the company.
    3.     The Actuate e.Spreadsheet engine consists of one or more JAR files within the Application Server framework. The Web UI utilizes these JAR files as well to perform report generation and data manipulation activities. In the case of the reporting functionality, the pdf report that is generated by Actuate is returned into either the Web UI or into the scripting component for persistence in the database. The mechanism exists to create multi-step jobs that can create multiple reports in one run.
    4.     So to facilitate the above, we are creating one or more Java Stored Procedures that will mediate the communication between the PL/SQL the user’s create and the Java components that are required for business processing. PL/SQL will invoke one or more Java Stored Procedures. Then the Java Stored Procedures invoke Actuate e.Spreadsheet, generate the report, saves the report in the database and returns control back to the invoking procedure.
    So the question is: Is this a viable and correct use of Oracle Java Stored Procedures. What are the advantages/disadvantages of doing so? Any security issues or potholes that you can think of? Tuning issues for the JVMs? Any white papers that you can think of?
    For any Oracle employees that respond, material such as Oracle Whitepapers, etc. would be great.
    I can be contacted at (313) 227-4350 or at [email protected]
    Thanks in advance.

    So are you planning on loading the entire e.Spreadsheet engine into the database server's JVM?
    If so, I would expect that to work, but I expect that you'd have some performance issues. I'd expect that the process of building these PDFs is going to be relatively expensive. Tuning the database server's JVM tends to be rather more challenging than tuning JVM's in an app server.
    If not, I'm not sure how the Java stored procedure would invoke the e.Spreadsheet engine on the application server. It is possible to use Oracle AQ to send a JMS message, but I don't think you can use the standard J2EE JMS APIs-- I think you'd have to use Oracle's AQ interface.
    Justin

Maybe you are looking for

  • CRM Communication structure not working in a copy client

    Hi all, my issue is the following. In client 300 CRM, defined as copy of client 100 communication structure CRMT_ACS_I_COM  is not filled by implementation of BADI CRM_COND_COM_BADI . Basically it is supposed that once you fill manually a field conta

  • Message Propagation within DB not working

    Hi, I am just following steps as depicted in reference manuals, to implement multiple consumer queue. What I found was even though I am enabling propagation message is not trnasferring to another queue. Can anybody suggest way of working out this. re

  • Sporadic invalid values obtained from FlexRIO card

    Hello, I'm having trouble acquiring data from my FlexRIO (PXIe-7962R + NI-5734). I'm writing custom code instead of using FIDL building blocks, because the FIDL requires a master-slave design for synchronized triggering, while I require every FlexRIO

  • Ipod won't reset no disk mode

    I had the folder icon show up and the unhappy ipod.... This is the second generation 10 gig ipod.. believe it or not it still holds a charge... I can't reset or get to disk mode.... any help would be great

  • ESS/MSS  with more ECC Systems sap.wdarfc.useSys Problem

    Hello , we have more a ECC Systems and on one ESS/MSS Portal. Now I found the url Parameter "sap.wdarfc.useSys" in the sdn.  In one test ESS Iview I set the Propoerty field to sap.wdarfc.useSys=SAP_R3_SelfServiceGenerics_MetaDataFIN:XY&sap.wdarfc.use