Java class in Oracle 8i.

Hi All,
I have tried to create a java class in Oracle8i but it throws some errors like:
NAMED "MyTime"
ERROR at line 3:
ORA-29516: Aurora assertion failure: Assertion failure at eox.c:187
Uncaught exception Root of all Java exceptions:
The program is :
CREATE OR REPLACE
JAVA SOURCE
NAMED "MyTime"
AS
import java.lang.String;
import java.sql.Timestamp;
public class MyTime
public static String getTime()
return (new Timestamp(System.currentTimeMillis())).toString();
Please give a solution ASAP.
If anybody knows give me more information about how the classes are created in the database and how itz get compiled.
Thanks in advance.
Rajesh

Anurag,
Here's an example of one I wrote which is VERY simple. Sometimes it helps to crawl before tou walk. You can execute the following using SQL*Plus:
CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED "RuntimeExample" AS public class RuntimeExample {
public static String runNotepad() {
String returnValue = null;
Runtime r = Runtime.getRuntime();
long totalMemory = r.totalMemory();
try {
     Process p = r.exec("notepad.exe");
     returnValue = p.toString();
     } catch (Exception e) {
          System.out.println("Exception calling Runtime.exec()->" + e);
     /* You can get creative here and
     1) Use p.waitFor() to block while the process is running,
     2) Send the command to be executed as a parameter to the method, etc. */
     return returnValue;
Notice that I return the string equivalent of Process p. This tells you if a process was really started.
Hope this helps,
-Dan
http://www.compuware.com/products/numega/dbpartner/dbpordebug.htm
Debug PL/SQL and Java in the Oracle Database

Similar Messages

  • Run a java class in Oracle db to connect to Sybase

    Hi All, I'm looking for a way to connect to Sybase database at no-license-cost (meaning Oracle Gateway or similar 3rd party products), first coming idea was JDBC, I know I can run a java class in Oracle, the simple idea is to write a java class which connects to Sybase via JDBC thin driver and return the resultset of given query in a java class, the resultset will be presented in Oracle Apex framework.  Does anyone know if this can be done or not, and how?  Any howto articles are welcomed.
    Henry

    Henry:
    To connect to Sysbase or MsSQL Server you could use jTDS open source driver.
    http://sourceforge.net/projects/jtds/
    upload above driver (jar file) using loadjava, and grants the port connection using dbms_java.grant_permission procedure.
    Because jTDS is pure java driver (mode 4) is possible to use directly inside the RDBMS.
    Best regards, Marcelo.
    PD: Latest jtds driver is compiled against 1.6 sources, but oldest version will work with 1.5 for 11g.

  • Java class in oracle apps forms

    java class in oracle apps forms
    We developed a java class and its running perfectly on local machine (Over the web through java applet ) But when we deployed it in apps and run with the client machine its not running .so please suggest where we put our java class files and how to run it in apps? Is there any API's .
    regards,
    krishna

    Hi user;
    What is your Client Operayting system, what is your browser?
    This error happens for one client or for all? Did you try to login from one other machine(for instance XP) and dif. browser version?
    Please check below which could be helpful for your issue:
    FRM-92101:
    Recommended Browsers for Oracle E-Business Suite Release 12 [ID 389422.1]
    FRM-92101: There Was a Failure in the Forms Server During Startup After Fresh R12 Installation [ID 429627.1]
    R12 fresh install FORMS DO NOT LAUNCH - FRM-92101/500 [ID 427714.1]
    FRM-92101: Forms Server oracle.forms.net.ConnectionException: Forms session <1> failed during startup: no response from runtime process [ID 880088.1]
    Also check:
    http://onlineappsdba.com/index.php/2009/06/15/frm-92101-with-internet-explorer-8-how-to-uninstall-ie8/
    Re: R12 database and JRE Issue
    Regard
    Helios

  • Unable to get database connection  from loaded java class in oracle

    Hi all,
    I am trying to call java class method from oracle function, but getting below exception, while creating connection.
    SQL> select charge_calculation(1,'2011-06-01', 'E') from dual;
    select charge_calculation(1,'2011-06-01', 'E') from dual
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.ExceptionInInitializerError
    inside main method
    inside main method1
    inside main method2
    inside main method3
    inside main method3
    Exception in thread "Root Thread" java.lang.ExceptionInInitializerError
    at javax.crypto.Cipher.getInstance(DashoA12275)
    at oracle.security.o5logon.O5LoginClientHelper.decryptAES(Unknown Source
    at oracle.security.o5logon.O5LoginClientHelper.generateOAuthResponse(Unk
    nown
    Source)
    at
    oracle.jdbc.driver.T4CTTIoauthenticate.marshalOauth(T4CTTIoauthenticate.java)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:367)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:
    501)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:203)
    at
    oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java)
    at java.sql.DriverManager.getConnection(DriverManager.java)
    at java.sql.DriverManager.getConnection(DriverManager.java:187)
    at SPEodPricing.spEodPricing(SPEODPRICING:98)
    at SPEodPricing.main1(SPEODPRICING:47)
    Caused by: java.lang.SecurityException: Cannot set up certs for trusted CAs
    at javax.crypto.SunJCE_b.<clinit>(DashoA12275)
    ... 13 more
    Caused by: java.security.PrivilegedActionException: java.io.IOException
    at java.security.AccessController.doPrivileged(Native Method)
    ... 14 more
    Caused by: java.io.IOException
    at java.io.FileOutputStream.writeBytes(Native Method)
    at java.io.FileOutputStream.write(FileOutputStream.java)
    at sun.net.www.protocol.jar.URLJarFile$1.run(URLJarFile.java:177)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.net.www.protocol.jar.URLJarFile.retrieve(URLJarFile.java:165)
    at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:43)
    at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:70)
    at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.ja
    va:102)
    at
    sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:1
    24)
    at javax.crypto.SunJCE_d.a(DashoA12275)
    at javax.crypto.SunJCE_b.g(DashoA12275)
    at javax.crypto.SunJCE_b.e(DashoA12275)
    at javax.crypto.SunJCE_q.run(DashoA12275)
    ... 15 more
    SQL> select charge_calculation(1,'2011-06-01', 'E') from dual;
    select charge_calculation(1,'2011-06-01', 'E') from dual
    ERROR at line 1:
    ORA-29549: class BBVA_MERGED.SPEodPricing has changed, Java session state
    cleared
    SQL> exit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64
    bit Production
    With the Partitioning, Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options
    JAVA Sample code:-
    public String method1(int pi_ctry_id,String pi_cur_busi_date ,String pi_eod_bod_flag)
    System.out.println("inside main method1");
    CachedRowSet tmplcrs                = null;
    HashMap resMap                              = new HashMap();
              Double ln_candidate_extra           = 0.0;
              Double ln_calculate_on_val          = 0.0;
              int lv_calculate_on                = 0;
              int lv_cand_attribute                = 0;
    // int pi_ctry_id                          = 0;
    // String pi_cur_busi_date           = null;
    int pi_bch_id                          = 0;
    // String pi_eod_bod_flag               = null;
    Date ldt_cur_busi_date          = null;
    Date lstr_next_calc_date     = null;
    int li_bch_id                         = 0;
    int li_chg_ac_branch               = 0;
    int calFrequency                     = 0;
    DbUtils dbObj = new DbUtils();
    Map reqMap = new HashMap();
    CachedRowSet updtcrs                = null;
    Connection conn = null;
              try
    System.out.println("inside main method2");
                   reqMap.put("pi_ctry_id", ""+pi_ctry_id);
                   reqMap.put("pi_cur_busi_date", ""+pi_cur_busi_date);
                   reqMap.put("pi_eod_bod_flag", ""+pi_eod_bod_flag);
    System.out.println("inside main method3");
                   Class.forName("oracle.jdbc.driver.OracleDriver");
    // Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@10.1.56.85:1521:orcl", "bbva_merged", "bbva_merged");
    // conn = DriverManager.getConnection("jdbc:oracle:thin:@10.1.50.104:1521:cmsdb6", "bbva_base", "bbva_base");
    System.out.println("inside main method3");
    conn = DriverManager.getConnection("jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.50.129)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.50.130)(PORT = 1521))(LOAD_BALANCE = yes)(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = BBVASIT)))", "BBVA_MERGED", "BBVA_MERGED");
    conn.setAutoCommit(false);
    System.out.println("inside main method4");
    }

    29532, 00000, "Java call terminated by uncaught Java exception: %s"
    // *Cause: A Java exception or error was signaled and could not be
    //          resolved by the Java code.
    // *Action: Modify Java code, if this behavior is not intended.

  • Error while importing java class into oracle forms 10g

    Hi
    I have generated a web service client using jdeveloper 10g. It consists of complex type methods. I am trying to import the class files using java importer in oracle form 10g. I am able import all of them successfully except one. That one is the main method. Please see the error and suggest me how to overcome this error.
    Exception occurred: java.lang.NoClassDefFoundError: oracle/jdeveloper/webservices/runtime/WrappedDocLiteralStub
    Thanks in advance

    Do you see oracle/jdeveloper listed in "Import Java Classes" when you try to import?
    If not, make sure you add C:\DevSuiteHome_1\jdev\lib\jdev.jar to FORMS_BUILDER_CLASSPATH in registry
    Also excetion indicates: oracle/jdeveloper/webservices/runtime/WrappedDocLiteralStub
    If you typing it - type: oracle.jdeveloper.webservices.runtime.WrappedDocLiteralStub

  • Java class in oracle forms

    Hello experts,
                        I am new in oracle forms.I am using oracle forms 11g with weblogic 10.3.5 at windows 7.Someone please clear me that the injection of java programing in oracle forms is through BEANS item only or I can use it(java class) as a part of my oracle forms.I mean I have a Java class.Could I use this java class inside my oracle forms without using Beans Item.
    Thank You
    regards
    aaaditya

    In forms you can use java in two different ways
    1. On the client-side. Using java-beans you can extend the client-functionality of forms. The code will run on the client-computer in the context of the applet.
    2. On the server-side. Using the java-importer you can build a PL/SQL-wrapper around a java-class and so use the java-code in your forms-PL/SQL
    What is your reuqirement?

  • Missing Java Classes in Oracle SQL Developer

    Hello,
    I'm pretty new to Oracle (As a DBA) and very new to Java. I just refreshed our training environment and after the refresh, noticed under the Java folder within Oracle SQL Devloper that the Java Classes were missing.
    Can someone tell me how I can repopulate these classes?
    Any information would be much appreciated.
    Thank you.

    Thank you K,
    The Java Classes are not present under the SYS user and I'm not sure how to get them back. They do exist within our production and development environments.

  • Generate Java class from Oracle Type defined in Package w/ JPublisher

    I was wondering if its possible to generate a Java class for an Oracle Type defined in a Package? I know passing the package name to JPublisher (SQL <package_name>) causes all Oracle Types in the Package to have a Java class generated for them but I'd like to be able to do this for an individual Type defined in a Package (something like SQL <package_name>.<type_name>).
    Thanks for any information you can give me.

    Hi Marinel,
    The support for XSD import is limited on 10.1.2. If you can, you should consider moving to the 10.1.3 preview as the support for document style web services has improved. The other option will be to inline the schema in your WSDL.
    Eric.

  • Problem when loading simple java class in Oracle

    Hi,
    I am using loadjava to load the java class in the oracle database. But it is failing. Can some one please help me out with this.
    Command.
    loadjava -thin -user username/password@zrtph0ja:1521:database -resolve firstProcedure.class
    Errors:
    Error while computing shortname of firstProcedure
    ORA-06550: line 1, column 13:
    PLS-00201: identifier 'DBMS_JAVA.SHORTNAME' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Error while computing shortname of firstProcedure
    ORA-06550: line 1, column 13:
    PLS-00201: identifier 'DBMS_JAVA.SHORTNAME' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    ORA-29521: referenced name java/io/PrintStream could not be found
    ORA-29521: referenced name java/lang/Object could not be found
    ORA-29521: referenced name java/lang/String could not be found
    ORA-29521: referenced name java/lang/StringBuffer could not be found
    ORA-29521: referenced name java/lang/System could not be found
    loadjava: 7 errors
    Please help.
    Regards
    Sudhir
    null

    U havent installed JServer in ur DBMS.
    Read the Oracle 8i JServer Manual for
    manually installing the Oracle JVM.

  • External Java Class and Oracle Workflow 2.6.3

    Hi,
    There is a requirement wherein I have to call an external Java class to fetch a string value from an external source and use that in the Oracle Workflow Notifications.
    After reading the Workflow documentation, I understand that Java classes can be called only for standalone version of the Workflow Builder (2.6.3). As the
    requirement is for an e-business suite implementation (11.5.10), I was wondering if there is a way to acheive this. Can an external Java class be called from within
    Oracle Workflow?
    I would really appreciate if someone can point me in the right direction.
    Many Thanks,
    Praveen

    Hi,
    If you write a wrapper to the java class in PL/SQL, then you can invoke that class from a PL/SQL activity conforming to the standard PL/SQL signature.
    HTH,
    Matt
    WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
    Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
    Have you read the blog at http://www.workflowfaq.com/blog ?
    WorkflowFAQ support forum: http://forum.workflowfaq.com

  • Error loading a java class to oracle db

    hi,
    my oracle server: 8i Enterprise Edition Release 8.1.7.0.0
    i want to load a simple java class into my oracle server.
    java source:
    public class Ping
         java.lang.String server;
         public static void main(java.lang.String[] args)
              System.out.println(new Ping().runCmd(args[0]));
         public static java.lang.String runCmd(String cmd)
    boolean result=false;
    int timeout=5000;
    try {            
    java.net.InetAddress byName=java.net.InetAddress.getByName(cmd);
                   result=byName.isReachable(timeout);
    catch(java.io.IOException e)
    e.printStackTrace();
         java.lang.String retVal=java.lang.Boolean.toString(result);
              return retVal;
    after compiling the java file. i'm using loadjava at dos prompt.
    loadjava -user uname/pwd@db -resolve Ping.class
    this command results in
    ORA-29545: badly formed class:
    loadjava: 1 errors
    alternatively i had used a command
    loadjava -user uname/pwd@db -noverify -resolve Ping.class
    this command results in
    Error while turning off verifier
    ORA-29532: Java call terminated by uncaught Java exception: java.security.Ac
    cessControlException: the Permission (oracle.aurora.security.JServerPermission V
    erifier ) has not been granted by dbms_java.grant_permission to SchemaProtection
    Domain(SMSPGS|PolicyTableProxy(SMSPGS))
    ORA-29545: badly formed class:
    loadjava: 2 errors
    but user is having sufficient rights (javasyspriv)
    what is wrong above, please help me.
    regards,
    s.mohamed asif

    hi,
    thanks for your response
    Ping.class just checks whether the specified node is reachable or not.
    result=byName.isReachable(timeout);
    the jdk loaded in oracle DB is older one and the method above java.net.InetAddress.isReachable(java.lang.int) is available since
    jdk 1.5
    source:
    public class Ping
    java.lang.String server;
    public static void main(java.lang.String[] args)
    System.out.println(new Ping().runCmd(args[0]));
    public static java.lang.String runCmd(String cmd)
    boolean result=false;
    int timeout=5000;
    try {
    java.net.InetAddress byName=java.net.InetAddress.getByName(cmd);
    result=byName.isReachable(timeout);
    catch(java.io.IOException e)
    e.printStackTrace();
    java.lang.String retVal=java.lang.Boolean.toString(result);
    return retVal;
    }how to load the new jdk set into existing oracle db server and replace the existing jdk.
    what can be done to achieve this ?
    regards,
    s.mohamed asif

  • Calling java class in oracle procedure

    i have one simple java program that prints 'hi' . i want to call that java program from pl/sql procedure.how to do that.

    This is one method I am demonstrating.
    SQL> CREATE or REPLACE AND COMPILE JAVA SOURCE NAMED "HiWorld" AS
      2  public class HiWorld {
      3 
      4   public static void MyMessage(String msg) {
      5    // TODO Auto-generated method stub
      6    System.out.println(msg);
      7    }
      8 
      9  }
    10  /
    Java created.
    SQL> CREATE or replace PROCEDURE hi_world (p_command  IN  VARCHAR2)
      2  AS LANGUAGE JAVA
      3  NAME 'HiWorld.MyMessage(java.lang.String)';
      4  /
    Procedure created.
    SQL> BEGIN
      2    DBMS_JAVA.SET_OUTPUT(1000000);
      3    hi_world('Saubhik');
      4  End;
      5  /
    PL/SQL procedure successfully completed.
    SQL> set serverout on
    SQL> /
    Saubhik
    Saubhik
    PL/SQL procedure successfully completed.Another method is loading the class file with "loadjava" command. In that case first step "CREATE or REPLACE AND COMPILE JAVA SOURCE NAMED "HiWorld" AS" is not required.

  • Avoid compilationof java class  in oracle using load java

    we are trying to load dom4j.jar file into oracle jvm using loadjava.
    command:
    loadjava -verbose -user un/pwd:host:port:sid dom4j.jar
    the loadjava utility unzip the jar and loads class files one by one.
    most of the classes are marked as invlid.
    if i use -resolve option in loadjava
    dependency classes are required.
    how to make class are valid without using the resolve option or without loading dependent jars.

    Try with -genmissing option.

  • How to pass a complex type as input for a Java class in Oracle 11g?

    Hi All,
    This is my Parent Class..
    package ADFapplnPackage.model;
    public class ParentClass {
    String Name;
    int age;
    public ParentClass() {
    super();
    This is my ChildClass :
    package ADFapplnPackage.model;
    public class ChildClass {
    public ChildClass() {
    super();
    public ParentClass display() {
    ParentClass obj=new ParentClass();
    obj.age=20;
    obj.Name="Sabari";
    return obj;
    I have exposed both of them as webservices.
    When I call the display object in the parent class,
    I am getting 'parent' as the response.. I mean that ,only the word 'parent' is at the response. I couldnt find any elements (i mean the age and name) in the output.
    if my function 'display' in the child class is like
    public String display() {
    return "hello";
    then it is working fine. I am getting "hello" in the response. Why is the webservice supporting only standard datatypes.. and not Class datatypes.
    Kindly help me!!
    Thanks ,
    Sabarisri. N

    Hi,
    You can't do that with OLEDB. None of OLEDB providers has such a feature.
    Yuancai (Charlie) Ye
    Use of free SocketPro package for creating super client and server application,
    See 30 well-tested and real OLEDB examples
    at http://www.udaparts.com

  • Oracle.apps.fnd.framework.OAException: Could not create Java class: (xxaai.oracle.apps.fnd.upload.webui.XxaaiBUDemandMassLoadPGCO)

    I have recently created a custom OAF app in JDev for R12.2.2.  In JDev this is working fine, so I have deployed this to the environment.  I created the function to access the page, but I am receiving this error.  I validated that the class and xml files match the name used in JDev and are in the correct location under $JAVA_TOP in the RUN environment.  As a test I created the same page in Jdev for 11.5.10 and the page deployed and worked fine.
    What could be the difference in R12.2.2? The only things that we have deployed so far are converted 11.5.10 apps that needed changes to the VO definitions for R12.2.2

    Just bringing this up to the top of the list to see if anyone else has had this same issue.

Maybe you are looking for

  • IdeaPad A1 Tablet problems

    I love my IdeaPad z580 laptop, best laptop ever! But my A1-07 tablet that was bundled with it is next to useless! I barely ever use it because I end up wanting to throw it across the room. Now that my husband bought an iPad mini I really want to have

  • Create a Purchase order using the BAPI using the data in the XML file.

    Hello Gurus, here is the scenario can anyone help me how to proceed explaining the procedure? Create a Purchase order using the BAPI using the data in the XML file. comprehensive explanations are appreciated. thanks in advance.

  • Error after applying the patch p12748351

    Hi experts, We installed the OIM version 11.1.1.1.5.0, and we implemented a solution almost out of the box. After the patching to the version 11.1.1.5.1 we faced an issue during the target reconciliation from AD for the new users. We see that no new

  • HP Officejet Pro X47 not picking up paper

    My warranty expired after one year exactly two weeks ago. Suddenly the printer has stopped printing, as it does not pick up the paper any longer. Help. The printer should still be in very good condition. The console is stuck displaying " Now Printing

  • Drawing a line

    Is it possible to just draw a few straight lines in FCP pro 5.0? Thanks - Alessandra