PL/SQL to Java Interface - Overwhelming Overhead?

My company is running Oracle 10g R2. I am currently exploring the use of java classes from PL/SQL. This is because we have multiple code bases, including Java, PowerBuilder (which can interface with Java), and PL/SQL (which can interface with Java).
Doing some performance testing, I found some rather alarming results. Running a simple java function 1 million times, I tested performance of PL./SQL to java and PowerBuilder to Java.
In PL/SQL, the 1 mil calls executed in ~120 s.
In PowerBuilder, the 1 mil calls executed in ~54 s.
Is it possible that our database is incorrectly configured for best java performance? Not only does it appear that PowerBuilder, a much less pervasive language than PL/SQL, is over twice as fast, but the PB test was run on my laptop, which is no where near as powerful as the database server that the PL/SQL procedure ran against, leading me to believe that the performance gap is actually much wider.
Anyone have any tips to improve the performance? Or is this simply the nature of the beast? I can't seem to find any posts on the net about people experiencing huge PL/SQL to Java overhead, so I'm hoping it is just something I am doing wrong.
Thanks for your help!
-Brett Birschbach

Below is my test code. Any suggestions are appreciated.
Thanks!
-Brett
==================================================
Java Class:
public class TestConvert {
    // For running straight from Java
    public static void main(String[] args){
        System.out.println(callAndTime());
    // For running 1 mil calls with only one call from PowerBuilder or PL/SQL
    public static long callAndTime(){
        TestConvert.convertEsnDecToHex("13005454488");
        long start = System.currentTimeMillis();
        for (int i = 0; i < 1000000; i++){
            TestConvert.convertEsnDecToHex("13005454488");
        long end = System.currentTimeMillis();
        return end-start;
    // For performing the actual work
    public static String convertEsnDecToHex(String esn) {
        String result = null;
        result = Integer.toHexString(new Integer(esn.substring(0, 3)).intValue());
        result += Integer.toHexString(new Integer(esn.substring(3)).intValue());
        return result.toUpperCase();
    // Non-static wrapper necessary for PowerBuilder
    public String callAndTimeNS(){
        return String.valueOf(callAndTime());
    // Non-static wrapper necessary for PowerBuilder 
    public String convertEsnDecToHexNS(String esn){
        return convertEsnDecToHex(esn);
}PL/SQL Script for 1 Million Java Calls:
DECLARE
  var       VARCHAR2( 20 );
  t_begin   NUMBER;
  t_end     NUMBER;
BEGIN
  var := testconvert.convertesndectohex( '13005454488' );
  t_begin := DBMS_UTILITY.get_time;
  FOR i IN 1 .. 1000000
  LOOP
    var := testconvert.convertesndectohex( '13005454488' );
  END LOOP;
  t_end := DBMS_UTILITY.get_time;
  DBMS_OUTPUT.put_line( var );
  DBMS_OUTPUT.put_line(  ( t_end - t_begin ) / 100 || ' seconds' );
END;
/PowerBuilder for 1 Million Java Calls:
EJBConnection lEJBConn
TestConvert lnv_test
String ls_ret
Long i
Time t_begin, t_end
lEJBConn = CREATE EJBConnection
lEJBConn.CreateJavaInstance( lnv_test, "TestConvert")
ls_ret = lnv_test.convertesndectohexns("13005454488")
t_begin = now()
FOR i = 1 TO 1000000          
     ls_ret = lnv_test.convertesndectohexns("13005454488")
NEXT
t_end = now()
MessageBox("Hex Version",ls_ret + " - " + String(SecondsAfter(t_begin, t_end)) + " seconds")
DESTROY lEJBConn

Similar Messages

  • PL/SQL and Java Swing interface

    Everybody in this forum knows that Oracle is the best database around
    with many functionalities, stability, performance, etc. We also know
    that PL/SQL is a great language to manipulate information directly
    in the database with many built in functions, OOP capability,
    transaction control, among other features. Today an application that
    manipulates information, which needs user interface, requires components
    to be developed using different technologies and normally running in
    different servers or machines. For example, the interface is done using
    a dynamic HTML generator like JSP, PHP, PL/SQL Web Toolkit, etc.
    This page is executed in an application server like Oracle iAS or
    Tomcat, just to name two, which in turn access a database like Oracle to
    build the HTML. Also rich clients like Java applets require an intermediate
    server to access the database (through servlets for example) although
    it is possible to access the database directly but with security issues.
    Another problem with this is that complexity increases a lot, many
    technologies, skills and places to maintain code which leads to a greater
    failure probability. Also, an application is constantly evolving, new
    calculations are added, new tables, changed columns. If you have an
    application with product code for example and you need to increase its
    size, you need to change it in the database, search for all occurrences
    of it in the middle-tier code and perhaps adjust interfaces. Normally
    there is no direct dependency among the tier components. On another
    issue, many application interfaces today are based on HTML which doesn't
    have interactive capabilities like rich-client interfaces. Although it
    is possible to simulate many GUI widgets with JavaScript and DHTML, it is
    far from the interactive level we can accomplish in rich clients like
    Java Swing, Flash MX, Win32, etc. HTML is also a "tag-based" language
    originally created to publish documents so even small pages require
    many bytes to be transmitted, far beyond of what we see on the screen.
    Even in fast networks you have a delay time to wait the page to be
    loaded. Another issue, the database is in general the central location
    for all kinds of data. Most applications relies on it for security,
    transaction and availability. My proposal is to use Oracle as the
    central location for interface, processing and data. With this approach
    we can create not only the data manipulation procedures in the database,
    but procedures that also control and manage user interfaces. Having
    a Oracle database as the central location for all components has many
    advantages:
    - Unique point of maintenance, backup and restore
    - Integrated database security
    - One language for everything, PL/SQL or Java (even both if desired)
    - Inherited database cache, transaction and processing optimizations
    - Direct access to the database dictionary
    - Application runs on Oracle which has support for many platforms.
    - Transparent use of parallel processing, clusters and future
    background technologies
    Regarding the interface, I already created a Java applet renderer
    which receives instructions from the database on how to create GUI
    objects and how to respond to events. The applet is only 8kb and can
    render any Swing or AWT object/event. The communication is done
    through HTTP or HTTPS using Oracles's MOD_PLSQL included in the Apache
    HTTP server which comes with the database or application server (iAS).
    I am also creating a database framework and APIs in PL/SQL to
    create and manipulate the client interface. The applet startup is
    very fast because it is very small, you don't need to download large
    classes with the client interface. Execution is done "on-demand"
    according to instructions received from the database. The instructions
    are very optimized in terms of network bandwidth and based on preliminary
    tests it can be up to 1/10 of a similar HTML screen. Less network usage
    means faster response and means that even low speed connections will
    have a good performance (a future development can be to use this in
    wireless devices like PDAs e even cell phones, just an idea for now).
    The applet can also be executed standalone by using Java Web Start.
    With this approach no business code, except the interface, is executed
    on the client. This means that alterations in the application are
    dynamically reflected in the client, no need to "re-download" the
    application. Events are transmitted when required only so network
    usage is minimized. It is also possible to establish triggering
    events to further reduce network usage. Since the protocol used is
    HTTP (which is stateless), the database framework I am creating will
    be responsible to maintain the state of connections, variables, locks
    and session information, so the developer don't need to worry about it.
    The framework will have many layers, from communication up to
    application so there will be pre-built functions to handle queries,
    pagination, lock, mail, log, etc. The final objective is to have a
    rich client application integrated into the database with minimum
    programming and maintenance requirements, not forgetting customization
    capabilities. Below is a very small example of what can de done. A
    desktop with two windows, each window with two fields, a button with an
    image to switch the values, and events to convert the typed text when
    leaving the field or double-clicking it. The "leave" event also has an
    optimization to only be triggered when the text changes. I am still
    developing the framework and adjusting the renderer but I think that all
    technical barriers were transposed by now. The framework is still in
    the early stages, my guess is that only 5% is done so far. As a future
    development even an IDE can be created so we have a graphical environment
    do develop applications. I am willing to share this with the PL/SQL
    community and listen to ideas and comments.
    Example:
    create or replace procedure demo1 (
    jre_version in varchar2 := '1.4.2_01',
    debug_info in varchar2 := 'false',
    compress_buffer in varchar2 := 'false',
    optimize_buffer in varchar2 := 'true'
    ) as
    begin
    interface.initialize('demo1_init','JGR Demo 1',jre_version,debug_info,compress_buffer,optimize_buffer);
    end;
    create or replace procedure demo1_init as
    begin
    toolkit.initialize;
    toolkit.create_icon('icon',interface.global_root_url||'img/switch.gif');
    toolkit.create_internal_frame('frame1','Frame 1',50,50,300,136);
    toolkit.create_label('frame1label1','frame1',10,10,50,20,'Field 1');
    toolkit.create_label('frame1label2','frame1',10,40,50,20,'Field 2');
    toolkit.create_text_field('frame1field1','frame1',50,10,230,20,'Field 1','Field 1',focus_event=>true,mouse_event=>true);
    toolkit.create_text_field('frame1field2','frame1',50,40,230,20,'Field 2','Field 2',focus_event=>true,mouse_event=>true);
    toolkit.set_text_field_event('frame1field1',toolkit.focus_lost_event,'demo1_set_upper',toolkit.get_text_method,'FIELD 1','false');
    toolkit.set_text_field_event('frame1field2',toolkit.focus_lost_event,'demo1_set_upper',toolkit.get_text_method,'FIELD 2','false');
    toolkit.set_text_field_event('frame1field1',toolkit.mouse_double_clicked_event,'demo1_set_lower',toolkit.get_text_method,'field 1','false');
    toolkit.set_text_field_event('frame1field2',toolkit.mouse_double_clicked_event,'demo1_set_lower',toolkit.get_text_method,'field 2','false');
    toolkit.create_button('button1','frame1',10,70,100,25,'Switch','Switch the values of "Field 1" and "Field 2"','S','icon');
    toolkit.set_button_event('button1',toolkit.action_performed_event,'demo1_switch_fields(''frame1field1'',''frame1field2'')','frame1field1:'||toolkit.get_text_method||',frame1field2:'||toolkit.get_text_method);
    toolkit.create_internal_frame('frame2','Frame 2',100,100,300,136);
    toolkit.create_label('frame2label1','frame2',10,10,50,20,'Field 1');
    toolkit.create_label('frame2label2','frame2',10,40,50,20,'Field 2');
    toolkit.create_text_field('frame2field1','frame2',50,10,230,20,'Field 1','Field 1',focus_event=>true,mouse_event=>true);
    toolkit.create_text_field('frame2field2','frame2',50,40,230,20,'Field 2','Field 2',focus_event=>true,mouse_event=>true);
    toolkit.set_text_field_event('frame2field1',toolkit.focus_lost_event,'demo1_set_upper',toolkit.get_text_method,'FIELD 1','false');
    toolkit.set_text_field_event('frame2field2',toolkit.focus_lost_event,'demo1_set_upper',toolkit.get_text_method,'FIELD 2','false');
    toolkit.set_text_field_event('frame2field1',toolkit.mouse_double_clicked_event,'demo1_set_lower',toolkit.get_text_method,'field 1','false');
    toolkit.set_text_field_event('frame2field2',toolkit.mouse_double_clicked_event,'demo1_set_lower',toolkit.get_text_method,'field 2','false');
    toolkit.create_button('button2','frame2',10,70,100,25,'Switch','Switch the values of "Field 1" and "Field 2"','S','icon');
    toolkit.set_button_event('button2',toolkit.action_performed_event,'demo1_switch_fields(''frame2field1'',''frame2field2'')','frame2field1:'||toolkit.get_text_method||',frame2field2:'||toolkit.get_text_method);
    end;
    create or replace procedure demo1_set_upper as
    begin
    toolkit.set_string_method(interface.global_object_name,toolkit.set_text_method,upper(interface.array_event_value(1)));
    toolkit.set_text_field_event(interface.global_object_name,toolkit.focus_lost_event,'demo1_set_upper',toolkit.get_text_method,upper(interface.array_event_value(1)),'false');
    end;
    create or replace procedure demo1_set_lower as
    begin
    toolkit.set_string_method(interface.global_object_name,toolkit.set_text_method,lower(interface.array_event_value(1)));
    toolkit.set_text_field_event(interface.global_object_name,toolkit.mouse_double_clicked_event,'demo1_set_lower',toolkit.get_text_method,lower(interface.array_event_value(1)),'false');
    end;
    create or replace procedure demo1_switch_fields (
    field1 in varchar2,
    field2 in varchar2
    ) as
    begin
    toolkit.set_string_method(field1,toolkit.set_text_method,interface.array_event_value(2));
    toolkit.set_string_method(field2,toolkit.set_text_method,interface.array_event_value(1));
    toolkit.set_text_field_event(field1,toolkit.focus_lost_event,'demo1_set_upper',toolkit.get_text_method,upper(interface.array_event_value(2)),'false');
    toolkit.set_text_field_event(field2,toolkit.focus_lost_event,'demo1_set_upper',toolkit.get_text_method,upper(interface.array_event_value(1)),'false');
    toolkit.set_text_field_event(field1,toolkit.mouse_double_clicked_event,'demo1_set_lower',toolkit.get_text_method,lower(interface.array_event_value(2)),'false');
    toolkit.set_text_field_event(field2,toolkit.mouse_double_clicked_event,'demo1_set_lower',toolkit.get_text_method,lower(interface.array_event_value(1)),'false');
    end;

    Is it sound like Oracle Portal?
    But you want to save a layer 9iAS.
    Basically, that was the WebDB.(Oracle changed the name to Portal when version 3.0)
    Over all, I agree with you.
    &gt;&gt;Having a Oracle database as the central location for all components has many
    &gt;&gt;advantages:
    &gt;&gt;
    &gt;&gt;- Unique point of maintenance, backup and restore
    &gt;&gt;- Integrated database security
    &gt;&gt;- One language for everything, PL/SQL or Java (even both if desired)
    &gt;&gt;- Inherited database cache, transaction and processing optimizations
    &gt;&gt;- Direct access to the database dictionary
    &gt;&gt;- Application runs on Oracle which has support for many platforms.
    &gt;&gt;- Transparent use of parallel processing, clusters and future
    &gt;&gt;background technologies
    I would like to build 'ZOPE' inside Oracle DB as a back-end
    Using Flash MX as front-end.
    Thomas Ku.

  • Are Java Interfaces 'free'?

    From a performance point of view, are Java interfaces free?
    That is, if I have:
    class Foo
    public void bar() { ... // some code }
    }and I change it to:
    interface Foo
    public void bar();
    class FooImpl implements Foo
    public void bar() { ... // some code }
    }And I call one or other of the Foos like
    Foo foo // A parameter, field or local variable.
    foo.bar();Does calling foo through an interface add any overhead that calling it direct in the first example not? As I understand it, all methods are 'virtual' in Java, so it should perform the same in either case.
    Thanks for any of your thoughts.
    Rupert

    rupertlssmith wrote:
    YoungWinston wrote:
    The Second Rule of Program Optimization (for experts only!): Don't do it yet.&#148;
    - Michael A. Jackson
    Basically, don't worry about it. Worry about writing clear, correct, object-oriented code.
    Wierdly enough, in the long run, that is more likely to help than anything else you can do, should (and if) you ever need to worry about optimization in the future.
    WinstonThanks for the advice. I can write good clear OO code. I am now at the future and worrying about optimization, so have made it past the second rule!Then you exactly know where your bottleneck is from the profiler you've used. Did it tell you that your interfaces are the bottleneck? If so, why do you even bother to ask here?

  • Problem with SQL system's interfaces.

    Hi Experts,
         There are a Proxy to JDBC Synchronous interface in Production environment. Here getting  the error " XIAdapterFramework- com.sap.engine.interfaces.messaging.api.exception.MessageExpiredException: Message
    4e53d84e-9a45-363a-e100-0000960096aa(INBOUND) expired". We can able to see the inbound payload from R/3 system but can't able to get the response payload from Sql system. At this time in R/3 system's T.code smq2 messages stucking in queues with status" sys fail" with description as " An exception occurred that was not caught. Particularly for this SQL server's interfaces are not working remaining all working smoothly. Asynchronous interfaces are working at the same time.
    BASIS team restarted the java stack of PI system, immediately all stucked messages in queues were cleared and issues resolved automatically, but again and again repeating only after 6pm since last 3 days, after restarting the PI java stack automatically resolving the problem. It is not at all the right solution bcz it is PRODUCTION System. Kindly suggest me.
    Thanks & Regards,
    Srihari.

    Hi Srihari,
    See thread below:
    [MessageExpiredException in the Sync XI--JDBC scenario|MessageExpiredException in the Sync XI--JDBC scenario;
    and SAP Notes
    [1356789 - Configuring timeout for dummy SQL query in advanced mode|https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1356789]
    [1078420 - XI/PI JDBC Adapter: Setting JDBC driver properties for DB|https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1078420]
    [1586058 - XI/PI Adapter for SQL Server:Overcoming DB Connection Issues|https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1586058]
    [1579879 - Adapter Framework - Message expired exception|https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3135373938373926]
    Regards.
    Pedro Baroni

  • Partner Application written in other language than PL/SQL and Java

    I have an application written in another language than PL/SQL or Java. I want to integrate this application as an Partner apps where I use the same user repository as Portal.
    Can I integrate the application by calling a stored PL/SQL-procedure based on the PLSQL SSO APIs examples that authenticates the user based on the username/password in portal and redirects the user to the application ?
    Are there any examples / references where this has been done ?
    Jens

    Check out the PDK referance for URL-Services, which allow you to integrate with any web based service/content.
    http://portalstudio.oracle.com/servlet/page?_pageid=350&_dad=ops&_schema=OPSTUDIO

  • What is the diffrence between package javax.sql and java.sql

    Is javax designed for J2EE?
    And when to use package javax?

    Hi,
    What is the diffrence between package javax.sql and java.sql?The JDBC 2.0 & above API is comprised of two packages:
    1.The java.sql package and
    2.The javax.sql package.
    java.sql provides features mostly related to client
    side database functionalities where as the javax.sql
    package, which adds server-side capabilities.
    You automatically get both packages when you download the JavaTM 2 Platform, Standard Edition, Version 1.4 (J2SETM) or the JavaTM 2, Platform Enterprise Edition, Version 1.3 (J2EETM).
    For further information on this please visit our website at http://java.sun.com/j2se/1.3/docs/guide/jdbc/index.html
    Hope this helps.
    Good Luck.
    Gayam.Srinivasa Reddy
    Developer Technical Support
    Sun Micro Systems
    http://www.sun.com/developers/support/

  • How to generate XML from relational data : PL/SQL or Java

    I'm new to Oracle XML and would appreciate some advice. I've been asked to generate XML documents from data stored in relational tables. The XML documents must be validated against a DTD. We will probably want to store the XML in the database.
    I've seen a PL/SQL based approach as follows :
    1.Mimic the structure of the DTD using SQL object types 2.Assign the relational data to the object type using PL/SQL as required
    3.Use the SYS_XMLGEN package to render the required XML documents from the SQL objects
    However, creating the object types seems to be quite time consuming (step 1 above) for anything other than the simplest of XML documents.
    I've also seen that there is the Java based approach, namely :
    1. Use the XML generator to build Java classes based on a DTD.
    2. Use these classes to build the required XML
    On the face of it, the Java based approach seems simpler. However, I'm not that familiar with Java.
    Which is the best way to proceed ? Is the PL/SQL based approach worth pursuing or should I bite the bullet and brush up my Java ?
    Is it possible to use a combination of PL/SQL and Java to populate the dtd generated java classes (step 2 of the Java approach) to reduce my learning curve ?
    Thanks in advance

    To help answer your questions:
    1) Now, in 9iR2, you can use SQL/XML as another choice.
    2) You can also use XSU to generate the XML and use XSLT to transform it to a desired format instead of using object views if possible.
    3) XDK provide Class generator support to populate XML data to Java classes.

  • PL/SQL w/ Java to run OS batch file crashes Oracle

    I followed instructions from "Ask Tom" on using PL/SQL with Java to execute an OS batch file. For testing purposes, my batch file does nothing more than display the date and time from the OS.
    However, when I run the PL/SQL that executes this simple batch file repeatedly - anywhere from two to four times, the Oracle instance crashes abruptly. Nothing is written to the alert log. No trace files are created.
    Here is a sample session:
    SQL*Plus: Release 9.0.1.3.0 - Production on Wed Mar 24 10:04:26 2004
    (c) Copyright 2001 Oracle Corporation. All rights reserved.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.1.0 - Production
    SQL> set serveroutput on size 1000000
    SQL> exec dbms_java.set_output(1000000) ;
    PL/SQL procedure successfully completed.
    SQL> begin
    2 rc('c:\dba_tools\jobs\test.cmd') ;
    3 end ;
    4 /
    C:\Ora9ir2\DATABASE>date /t
    Wed 03/24/2004
    C:\Ora9ir2\DATABASE>time /t
    10:05 AM
    PL/SQL procedure successfully completed.
    SQL> begin
    2 rc('c:\dba_tools\jobs\test.cmd') ;
    3 end ;
    4 /
    C:\Ora9ir2\DATABASE>date /t
    Wed 03/24/2004
    C:\Ora9ir2\DATABASE>time /t
    10:06 AM
    PL/SQL procedure successfully completed.
    SQL>
    Shortly after the second "run", Oracle crashed. All I received was the following error message:
    Unhandled exception in oracle.exe (ORAJOX9.DLL): 0xC0000005: Access Violation
    Here is the Java procedure at the heart of my PL/SQL:
    create or replace and compile
    java source named "Util"
    as
    import java.io.*;
    import java.lang.*;
    public class Util extends Object
    public static int RunThis(String args)
    Runtime rt = Runtime.getRuntime();
    int rc = -1;
    try
    Process p = rt.exec(args);
    int bufSize = 4096;
    BufferedInputStream bis =
    new BufferedInputStream(p.getInputStream(), bufSize);
    int len;
    byte buffer[] = new byte[bufSize];
    // Echo back what the program spit out
    while ((len = bis.read(buffer, 0, bufSize)) != -1)
    System.out.write(buffer, 0, len);
    rc = p.waitFor();
    catch (Exception e)
    e.printStackTrace();
    rc = -1;
    finally
    return rc;
    I am running Oracle 9i rel. 2 installed on my PC under Windows XP Professional (Service Pack 2). My knowledge of Java is next to nothing.
    Can anyone give me an idea(s) as to what might be causing Oracle to crash?
    Thanks.

    Using 9.2.0.4 I made the following adjustments and it seems to run as often as I care to do it:
    Java changes:
    create or replace and compile
    java source named "Util"
    as
    import java.io.*;
    import java.lang.*;
    public class Util extends Object
    public static void RunThis(java.lang.String args)
    Runtime rt = Runtime.getRuntime();
    int rc = -1;
    try
    Process p = rt.exec(args);
    int bufSize = 4096;
    BufferedInputStream bis =
    new BufferedInputStream(p.getInputStream(), bufSize)
    int len;
    byte buffer[] = new byte[bufSize];
    // Echo back what the program spit out
    while ((len = bis.read(buffer, 0, bufSize)) != -1)
    System.out.write(buffer, 0, len);
    rc = p.waitFor();
    catch (Exception e)
    e.printStackTrace();
    finally
    PL/SQL Wrapper :
    create or replace procedure rc (cmd VARCHAR2) as
    language java name 'Util.RunThis(java.lang.String)';
    Execution:
    begin
    rc('c:\dba_tools\jobs\test.cmd');
    end ;
    D:\oracle\ora92\DATABASE>date /t
    Fri 03/26/2004
    D:\oracle\ora92\DATABASE>time /t
    10:48 AM
    PL/SQL procedure successfully completed.
    SQL> /
    D:\oracle\ora92\DATABASE>date /t
    Fri 03/26/2004
    D:\oracle\ora92\DATABASE>time /t
    10:48 AM
    PL/SQL procedure successfully completed.
    SQL> /
    D:\oracle\ora92\DATABASE>date /t
    Fri 03/26/2004
    D:\oracle\ora92\DATABASE>time /t
    10:49 AM
    PL/SQL procedure successfully completed.
    SQL> /
    D:\oracle\ora92\DATABASE>date /t
    Fri 03/26/2004
    D:\oracle\ora92\DATABASE>time /t
    10:50 AM
    PL/SQL procedure successfully completed.
    SQL>
    The only thing I really changed was the reurn value from the java procedure. If it has a return value then it should be declared as a function, not a procedure. Since you probably (apparently) weren't using the return value I dropped it and made it a procedure.

  • Xml dom with pl/sql or java

    Hi,
    For increase speed an procedure with xmldom, wich langage can I use ? pl/sql or java
    Thanks
    Ben

    I also recall readings somewhere how Oracle have coded the database packages into native C to boost performance, but for the life of me I can't recall where it was now.
    I've not done any Java parsing work, but I have been using PL/SQL to parse XML Schema documents (which are in effect XML documents so there's no difference there really). I found that all I needed to be able to parse the XML schema so that I could navigate through the document and carry out my own processing was the use of the DBMS_XMLDOM package. This allowed me to navigate from the root element down through the siblings and children elements and extract the attributes and any data that was required on the way.
    The Oracle PL/SQL Packages and Types Reference details all the available built-in packages sufficiently well.
    Regards

  • File Deletion from PL/SQL using Java

    I'm able to delete a file on the OS from PL/SQL by calling a java class. But there is a problem if I am trying to delete any file located on any machine othere than the one on which the Database is hosted.
    Can anyone tell me how delete a file which is on anothere machin using PL/SQL with Java ?

    You can use a FTP Call: http://www.savarese.org/oro/software/NetComponents.html

  • Java Interface Question.

    There are classes in the Java SDK, such as the Interface:
    org.w3c.dom.Document
    that have factory methods in them that carry out actual operations.
    But how can this be possible, because when I program an interface:
    public interface test {
    public void setString(String s);
    It will only compile thus, with no implementation on the method signatures?
    How do Java interfaces with factory methods to this?
    org.w3c.dom.Node is another one. Where does the functionality/method implementation
    come from?

    public interface MyInterface {
         public void method1();
    class MyImplementation implements MyInterface {
         public void method1(){
    public class MyFactory {
         public static MyInterface createMyInterface(){
              return new MyImplementation();
    public class Test{
               public static void main(String args[]){
                      MyInterface x=MyFactory.createMyInterface();
                      x..method1();
    }Now can you understand this? Assume all These classes are separate classes. This is not a problem with inner classes. Before make a reply, try to understand it or post a reply as saying it is not clear rather than posting this kind of post.

  • Execution/ better performace on sql  or  java)

    hi experts,
    i would like to began a topic on better performance or best pratice adf using sql or java codes.
    basically am from Oracle forms - pl/sql background. well i knew about java and i have some awareness on Exception(my code maynt be consistent somtimes(run time) or or in other words sometimes ran into run time exceptions based on the user entries).
    say as example: consider this scenario.
    i had input lov named as employee, if the entered data is not avaiable i would throw an entered employee is not found.
    basically i would like to follow this method.
    method 1:
    vo query :
    Select * From sometable
    Where Btx = :px1 And
    :px2 Between Btbx And Btbxo And Btb_x=:pxamimpl.code
    public void Validatex(String px ,String px1, oracle.jbo.domain.Date px2 ) {
           someVOImpl vo1 = (someVOImpl)this.getsomeRequest1();
            Row r = vo1.getCurrentRow();
            String Schx = (String)r.getAttribute("Btrxxx");
              if(Schxx.equals("somevalue"))
                xffVOImpl vo2 = (xffVOImpl)this.getxkEff1();
                vo2.setNamedWhereClauseParam("px", px.toString());
                vo2.setNamedWhereClauseParam("px1", px1.toString());
                vo2.setNamedWhereClauseParam("px2", px2);
                vo2.executeQuery();
                 if(vo2.getEstimatedRowCount() == 0)
                   throw new JboException("xxx Not Found");
           if(Scheme.equalsIgnoreCase("somevalue"))
            xxffVOImpl vo = (xxxffVOImpl)this.getxxkEff1();
            vo.setNamedWhereClauseParam("px", px);
            vo.setNamedWhereClauseParam("px1", px1);
            vo.setNamedWhereClauseParam("px2", px2);
            vo.executeQuery();
             if(vo.getEstimatedRowCount() == 0)
                throw new JboException("xxx Not Found");
           }this will exposed as method called in when valuechange listeners. it's work fine.
    my question is :
    if i wrote same thing in java like this. i think it take some more time than above methods sometimes exceptions comes out.
    public void Validatex(String px ,String px1, oracle.jbo.domain.Date px2 ) {
    some vos... as like same of which i mentioned above
    using iterator iterate each and every row.
    try{
    for (.......)
    if(...)
    else
    } } catch()
    }which would be best practice.? i hope that iterating each and every row taking little bit amount of time.
    but i feel that method1 without any exception and smarter time produce result.
    so people suggest me ? where am which would be better approach.
    thanks&&REgards
    adf7.

    Hi,
    before went into testing. could please tel me. how to get/display both of the method time taken to execute and some memory consumption.See if this helps..
        public HashMap doSomethingInProc(Long serialNo, Long custNo) {
            HashMap map = new HashMap();
            CallableStatement cs = null;
            String stmt = "sy_pkg_xx.p_doSomethingInProc(?,?,?,?)";
            logger.info("execute " + stmt);
            try {
                cs = getCurrentConnection().prepareCall("begin " + stmt + "; end;");
                cs.registerOutParameter("O_2", OracleTypes.VARCHAR);
                cs.registerOutParameter("O_1", OracleTypes.NUMBER);
                cs.setLong("I_SerialNo", serialNo);
                cs.setLong("I_CustNo", custNo);
                Long start = System.currentTimeMillis();
                cs.execute();
                Long end = System.currentTimeMillis();
                logger.info("time taken to execute " + stmt + " : " + (end - start) + " ms.");
                map.put("1", cs.getString("O_1"));
                map.put("2", cs.getLong("O_2"));
                logger.info("map : " + map.toString());
            } catch (SQLException e) {
                throw new JboException(e);
                }finally{
                if(cs!=null){
                    try{
                        cs.close();
                    }catch(SQLException ex){
            return map;
        private Connection getCurrentConnection() {
            Statement st = null;
            try {
                st = getDBTransaction().createStatement(0);
                return st.getConnection();
            } catch (SQLException s) {
                s.printStackTrace();
                return null;
            } finally {
                if (st != null)
                    try {
                        st.close();
                    } catch (SQLException s2) {
        }The main code is
                Long start = System.currentTimeMillis();
                cs.execute();
                Long end = System.currentTimeMillis();
                logger.info("time taken to execute " + stmt + " : " + (end - start) + " ms.");In fact i say that every body should use this approach while executing any procedure or function as it helps us to track which part of application is running slow..
    Hope this helps !!!
    Regards,
    Edited by: Santosh Vaza on Jul 16, 2012 3:50 PM

  • Some problems about oracle.sql.CharacterSet.java

    When I debugging a program,which should execute an insert statement into Oracle database,but I found there's missing Oracle.sql.CharacterSet.java source file&#65292;and some errors occur&#65306;
    java.sql.SQLException: ORA-01400: cannot insert NULL into ("EPICS"."IOC_DB_FILE_ASGN"."EXT_SRC_FILE_NM")
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:124)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:304)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:271)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:622)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:180)
    at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:542)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1027)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2887)
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:2978)
    at gov.sns.apps.jeri.apps.dbimport.DBFileParser.updateDBFileIOCData(DBFileParser.java:3028)
    at gov.sns.apps.jeri.apps.dbimport.DBFileParser.saveToDatabase(DBFileParser.java:2930)
    at gov.sns.apps.jeri.apps.dbimport.DBImportFrame$19.run(DBImportFrame.java:640)
    at java.lang.Thread.run(Thread.java:534)
    The database is Oracle 10g&#65292;and development tools is Jdeveloper10g&#12290;I have added oracle_home/jdbc/lib/classes12.jar into the classpath.but it doesn't work&#12290;I hope someone can tell me what's the matter and how to get the source file of CharacterSet.java&#65311;I'll be very grateful for your help!Thank you very much!

    hello user457523
    I have found the reason to that error.It's because there's a trigger and ext_src_file_nm is populated by the trigger from another column ext_src_file_loc when inserting and I didn't give any value to ext_src_file_loc so ext_src_file_nm is null.
    I have disabled that trigger and now I get new errors.When I traced to a line of Jave code I got missing source file warning,and the source file is also oracle.sql.CharacterSet.java.I can not trace into the source file and then I skipped that code and then I got new errors.I want to know how to trace into the jave code and find what's the matter.
    Thank you very much.

  • Java interface with Crystal Reports

    Post Author: [email protected]
    CA Forum: JAVA
    Hello everyone,I need to build a Java interface for JSP to interact with crystal reports.Could anyone recommend any book or forward me the url's where I can find the related material with examples. Eagerly Waiting for reply!Thanks,Prathima.

    Post Author: MJ@BOBJ
    CA Forum: JAVA
    The latest version of the Java Report Component (JRC) is available from the Diamond website.  This download is actually a plugin for Eclipse but you can still use the JRC runtime jars to use the SDK APIs in your JSP page.  You will also find lots of resources such as samples, videos, and forums to help you get started.  You can also refer to the DevLibrary for more information.

  • Oracle Express 10g - a way to terminate in SQL Command Line interface

    I've downloaded Oracle Express 10g and use the SQL Command Line interface to execute SQL*Plus -- a really simple window / interface without hardly any smarts. In other Oracle installations' SQL*Plus, I'm used to be able to do a Ctrl C to terminate the current SQL that's being executed and the session is still active and I can keep using it. But with the Oracle Express 10g SQL Command Line interface, when I do a Ctrl C the currrent SQL is terminated -- but so is the whole dang session and the window goes away too. There must be a way in the Oracle Express 10g SQL Command Line interface to simply terminate th current SQL results without losing the whole dang session!!! This is so incredibly frustrating it's not even funny. HELP!!!!

    I think your answer is in this thread:
    Re: stopping a query
    Regards, Marc

Maybe you are looking for

  • Content Editing Problem

    I have placed content on a DW template page using the Javascript behavior to set text of container in a static html page. This div container is nested within another div container which is editable. I have several links that when clicked sets the tex

  • After restart Oracle Report Server some reports start automatically to run.

    When our report server is restarted always a number of reports are started automatically. I don't know why these are started automatically? Is there a avoid starting these reports?

  • Importing artwork into iPhoto (6)?

    I understand RGB files are required, but what formats are acceptable besides JPEG? How about PNG or TIFF? I have digital artwork to import and I've had success with with JPEGs, but that format is very limited. I've made slideshows and uploaded them a

  • Adobe Pro 8 and Windows 7

    I am trying to set up Adobe Pro * and install it on the virtual XP mode in Windows 7.  However, it keeps telling me in XP mode that an instance of installation is already running.  I restarted the computer, inserted the disk, killed autoplay in windo

  • Download of Photoshop CS5 trial stuck in "Extracting"

    Hello, Today I went to download the 30 day free trial of CS5 and got through most of the steps, an error message popped up but now I am looking at the still open Adobe Download assistant which just says "Extracting..." with the status bar moving. Ple