OCI Function call vs Odatabase Class

In my application I've used ODatabase class to
open a database connection.
At the same time, I use OCI function calls method to connect to the same database. This is use to execute store procedure & query.
My question is that does it cause double connection to Oracle?

Yes.

Similar Messages

  • Are OCI Function calls secure enough?

    Dear Friends,
    I would like to know if the OCI programming is used these days. If yes, are these calls secure enough to take care of the ever increasing frauds.
    Regards
    Bhaskar Divecha

    I am using OCI in my application and using it connect to an Oracle Instance over the network.
    How secure will the username, password and data be?
    Is it sent over the network as clear text? Or is there any encryption involved?
    What is Oracle Advanced Security? How can I configure this?
    Found this thread, but it wasnt very helpful.
    Re: Are OCI Function calls secure enough?
    Thanks in advance,
    Harsha

  • Best way to call a function in a generic class from a base class

    Hi,
    I have a generic class that works with subclasses of some other baseclass. When I construct the subclass, I call the constructor of the baseclass which I want to call a function in the generic class. e.g. suppose I have the following classes
    public class List<T extends BaseClass>
        newTCreated(T t)
    }

    Sorry, I pressed Tab and Enter last time when typing the code so I posted without meaning to
    Hi,
    I have a generic class that works with subclasses of some other baseclass. When I construct the subclass, I call the constructor of the baseclass which I want to call a function in the generic class. e.g. suppose I have the following classes
    public class List<T extends BaseClass>
        public void newTCreated(T t)
            // add the t to some internal list
        public T getT(int index)
            // get the object from the internal list
    public class BaseClass
        public BaseClass(List<?> list)
            list.newTCreated(this);
    public class SubClass extends BaseClass
        public SubClass(List<SubCass> list)
            super(list);
    }This doesn't compile because of the call to newTCreated in the BaseClass constructor because BaseClass is not necessarily of type T. Is there any way of checking when I call the newTCreated function that the BaseClass is actually of type SubClass? I could either add the call explicitly in each SubClass's constructor or have a function addToList in BaseClass that is called from the BaseClass constructor but overloaded in each subclass but both of those rely on future subclasses doing the same. Or I could change the newTCreated function to take an argument of type BaseClass and then cast it to type T but this doesn't give a compilation error, only a runtime exception.
    It seems like there should be solution but having only recently started writing Generic classes I can't find it. Thanks in advance for any help,
    Tom

  • Problem Calling a Java class from PLSQL function

    We are calling a Java class through oracle function as
    FUNCTION CalculateAMW (contributorid IN Number,
    fromdate IN Date,OHorAnncoverage in Number,
    OHAnncoverage in Number,
    AppStatus in Number,
    Status in Number)
    RETURN Number
    AS LANGUAGE JAVA
    NAME 'AMWCalculations.calculateAMW
    (long,java.sql.Timestamp,long,long,long,long) return double';
    on execution of this function the sql prompt for the 1st time it is giving the output
    but
    if reexecute it is throwing and error ORA - 932 : Inconsistent
    datatypes.
    Recompiling the java class then it works for the 1st time and the next
    time
    we execute it throws error as explained above.
    What could be the problem.
    Thanks
    Nanda Kishore

    any idea???Yes, you are in the wrong forum, this is a Java forum, you have an ASP question, so i suggest you visit an ASP forum/site

  • Calling a Function Pool inside a Class

    Hi,
        I want to call a Function Pool inside a Class Method. I am getting an Error that 'Report or Program Statement already exists' when I call the function pool in the method. can anybody help me on how to call a Function Pool inside a class method.

    Hello Krish
    Based on your error description I assume that you have tried to "insert" the function pool program (e.g. function group ZFUNC -> SAPLZFUNC) into your class.
    You cannot do that. The explanation for the error message is a following:
    - The class contains already a program statement (CLASS-POOL). If there is somewhere in the class an additional program statement (e.g. FUNCTION-POOL) you will get the error.
    In addition, you cannot "call" a function pool. Instead you can always call the function modules of your function group.
    Regards
      Uwe

  • Call function defined in other class

    Hi..
    I am new to Java programing .
    I want to know how to call a function defined in second class from first class.
    Please help me.

    Hi..
    If both the classes are in same package, and the function is not private, u can call the function by using an object of the second class. If they r in separate packages, u have to import the package in which the second class is. In any case, public methods are allowed and private methods are not allowed to be invoked.
    Hope this info may help u..

  • MovieClipLoader Class doesn't allow function calls

    I have functions within a movieClip that loads into a main
    movie. The functions operate with no problem when using loadMovie
    method, but I need to execute some script after loading so I
    switched to the movieClipLoader class instead.
    Problem is, after the movieClip is loaded, any function calls
    from a keyframe (or even a button) are totally ignored.
    What am I missing. Should I be doing something different?
    here is my movieClipLoader code:

    Actually, I think I found the solution after looking at some
    other posts. I changed "onLoadComplete" to "onLoadInit" and it
    worked.
    As I found in another post, onLoadComplete doesn't mean all
    of the code is loaded yet, but onLoadInit means the movie and code
    is loaded.

  • Program blocked in oci function

    Hello,
    When I read data from the database, everything works well. But when my program run some time, it blocked in oci function and can't work.
    Here is a stack from my code:
    GNU gdb 6.6
    Copyright (C) 2006 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and you are
    welcome to change it and/or distribute copies of it under certain conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB. Type "show warranty" for details.
    This GDB was configured as "i586-suse-linux"...
    Using host libthread_db library "/lib/libthread_db.so.1".
    Attaching to program: /usr/local/fountain/shinedb/bin/dbsyndata, process 5609
    Reading symbols from /usr/local/fountain/shinedb/lib/libmdbcore.so...done.
    Loaded symbols for /usr/local/fountain/shinedb/lib/libmdbcore.so
    Reading symbols from /usr/local/fountain/shinedb/lib/libdbapi.so...done.
    Loaded symbols for /usr/local/fountain/shinedb/lib/libdbapi.so
    Reading symbols from /usr/local/fountain/shinedb/lib/libhdb.so...done.
    Loaded symbols for /usr/local/fountain/shinedb/lib/libhdb.so
    Reading symbols from /usr/lib/libstdc++.so.6...done.
    Loaded symbols for /usr/lib/libstdc++.so.6
    Reading symbols from /lib/libm.so.6...done.
    Loaded symbols for /lib/libm.so.6
    Reading symbols from /lib/libgcc_s.so.1...done.
    Loaded symbols for /lib/libgcc_s.so.1
    Reading symbols from /lib/libc.so.6...done.
    Loaded symbols for /lib/libc.so.6
    Reading symbols from /usr/local/fountain/shinedb/lib/libpub.so...done.
    Loaded symbols for /usr/local/fountain/shinedb/lib/libpub.so
    Reading symbols from /lib/libpthread.so.0...done.
    [Thread debugging using libthread_db enabled]
    [New Thread -1232918864 (LWP 5609)]
    Loaded symbols for /lib/libpthread.so.0
    Reading symbols from /usr/local/fountain/oracle/oracle/product/10.2.0/client_1/lib/libclntsh.so.10.1...done.
    Loaded symbols for /usr/local/fountain/oracle/oracle/product/10.2.0/client_1/lib/libclntsh.so.10.1
    Reading symbols from /usr/local/fountain/shinedb/lib/libnvlist.so...done.
    Loaded symbols for /usr/local/fountain/shinedb/lib/libnvlist.so
    Reading symbols from /lib/ld-linux.so.2...done.
    Loaded symbols for /lib/ld-linux.so.2
    Reading symbols from /usr/local/fountain/oracle/oracle/product/10.2.0/client_1/lib/libnnz10.so...done.
    Loaded symbols for /usr/local/fountain/oracle/oracle/product/10.2.0/client_1/lib/libnnz10.so
    Reading symbols from /lib/libdl.so.2...done.
    Loaded symbols for /lib/libdl.so.2
    Reading symbols from /lib/libnsl.so.1...done.
    Loaded symbols for /lib/libnsl.so.1
    Reading symbols from /usr/local/lib/libutils.so...done.
    Loaded symbols for /usr/local/lib/libutils.so
    0xffffe410 in __kernel_vsyscall ()
    (gdb) where
    #0 0xffffe410 in __kernel_vsyscall ()
    #1 0xb7d8aa63 in __read_nocancel () from /lib/libc.so.6
    #2 0xb7430db3 in snttread ()
    from /usr/local/fountain/oracle/oracle/product/10.2.0/client_1/lib/libclntsh.so.10.1
    #3 0xb742e38a in nttrd ()
    from /usr/local/fountain/oracle/oracle/product/10.2.0/client_1/lib/libclntsh.so.10.1
    #4 0xb731fccc in nsprecv ()
    from /usr/local/fountain/oracle/oracle/product/10.2.0/client_1/lib/libclntsh.so.10.1
    #5 0xb7322f97 in nsrdr ()
    from /usr/local/fountain/oracle/oracle/product/10.2.0/client_1/lib/libclntsh.so.10.1
    #6 0xb73059e3 in nsdo ()
    from /usr/local/fountain/oracle/oracle/product/10.2.0/client_1/lib/libclntsh.so.10.1
    #7 0xb7302c83 in nsbrecv ()
    from /usr/local/fountain/oracle/oracle/product/10.2.0/client_1/lib/libclntsh.so.10.1
    #8 0xb7335b43 in nioqrc ()
    from /usr/local/fountain/oracle/oracle/product/10.2.0/client_1/lib/libclntsh.so.10.1
    #9 0xb7448d27 in ttcdrv ()
    ---Type <return> to continue, or q <return> to quit---
    from /usr/local/fountain/oracle/oracle/product/10.2.0/client_1/lib/libclntsh.so.10.1
    #10 0xb733cea5 in nioqwa ()
    from /usr/local/fountain/oracle/oracle/product/10.2.0/client_1/lib/libclntsh.so.10.1
    #11 0xb71a12bb in upirtrc ()
    from /usr/local/fountain/oracle/oracle/product/10.2.0/client_1/lib/libclntsh.so.10.1
    #12 0xb7116f5a in kpurcsc ()
    from /usr/local/fountain/oracle/oracle/product/10.2.0/client_1/lib/libclntsh.so.10.1
    #13 0xb70cc59f in kpuexecv8 ()
    from /usr/local/fountain/oracle/oracle/product/10.2.0/client_1/lib/libclntsh.so.10.1
    #14 0xb70ce92e in kpuexec ()
    from /usr/local/fountain/oracle/oracle/product/10.2.0/client_1/lib/libclntsh.so.10.1
    #15 0xb71a5e26 in OCIStmtExecute ()
    from /usr/local/fountain/oracle/oracle/product/10.2.0/client_1/lib/libclntsh.so.10.1
    Thanks.

    hi Nikeda,
    I replaced the sizeof(double) to DBL_DIG/FLT_DIG constant, now the program doesn't crashes but the conversion is not happening properly.
    The result of any number after conversion is "0".
    Any suggestions, Thanks in advance .. below is the code snippet u asked for ..
    class ABC
    double qty ;
    ott structure
    struct abc_ott
    OCINumber qty ;
    // pro*c code
    EXEC SQL BEGIN DECLARE SECTION ;
    abc_ott * abc_ott_inst ;
    EXEC SQL END DECLARE SECTION ;
    EXEC SQL ALLOCATE :abc_ott_inst ;
    ABC * abc = new ABC ;
    abc->qty = 100.0 ;
    OCINumberFromReal(ociError, &abc->qty, (uword)sizeof(double), &abc_ott_inst->qty ) ;
    // call with DBL_DIG
    OCINumberFromReal(ociError, &abc->qty, DBL_DIG, &abc_ott_inst->qty ) ;
    Edited by: user3894537 on May 20, 2010 8:25 AM
    Edited by: user3894537 on May 20, 2010 8:38 AM

  • How to call a C function calling a Java Method from another C function ?

    Hi everyone,
    I'm just starting to learn JNI and my problem is that I don't know if it is possible to call a C function calling a Java Method (or doing anything else with JNI) from another C function.
    In fact, after receiving datas in a socket made by a C function, I would like to create a class instance (and I don't know how to do it too ; ) ) and init this instance with the strings I received in the socket.
    Is all that possible ?
    Thank you very much for your help !

    Hard to understand the question, but by most interpretations the answer is going to be yes.
    You do of course understand that JNI is the "API" that sits between Java and C and that every call between the two must go through that. You can't call it directly.

  • Java.lang.VerifyError - Incompatible object argument for function call

    Hi all,
    I'm developing a JSP application (powered by Tomcat 4.0.1 in JDK 1.3, in Eclipse 3.3). Among other stuff I have 3 classes interacting with an Oracle database, covering 3 use cases - renaming, adding and deleting an database object. The renaming class simply updates the database with a String variable it receives from the request object, whereas the other two classes perform some calculations with the request data and update the database accordingly.
    When the adding or deleting classes are executed, by performing the appropriate actions through the web application, Tomcat throws the following:
    java.lang.VerifyError: (class: action/GliederungNewAction, method: insertNewNode signature: (Loracle/jdbc/driver/OracleConnection;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V) Incompatible object argument for function call
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:120)
         at action.ActionMapping.perform(ActionMapping.java:53)
         at ControllerServlet.doResponse(ControllerServlet.java:92)
         at ControllerServlet.doPost(ControllerServlet.java:50)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    ...The renaming works fine though. I have checked mailing lists and forums as well as contacted the company's java support but everything I have tried out so far, from exchanging the xerces.jar files found in JDOM and Tomcat to rebuidling the project didn't help.
    I just can't explain to myself why this error occurs and I don't see how some additional Java code in the other 2 classes could cause it?
    I realize that the Tomcat and JDK versions I'm using are totally out of date, but that's company's current standard and I can't really change that.
    Here's the source code. I moved parts of the business logic from Java to Oracle recently but I left the SQL statements that the Oracle stored procedures are executing if it helps someone.
    package action;
    import java.sql.CallableStatement;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.StringTokenizer;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    import oracle.jdbc.driver.OracleConnection;
    * This class enables the creation and insertion of a new catalogue node. A new node
    * is always inserted as the last child of the selected parent node.
    public class GliederungNewAction implements Action {
         public String perform(ActionMapping mapping, HttpServletRequest request,
                   HttpServletResponse response) {
              // fetch the necessary parameters from the JSP site
              // the parent attribute is the selected attribute!
              String parent_attribute = request.getParameter("attr");
              String catalogue = request.getParameter("catalogue");
              int parent_sequenceNr = Integer.parseInt(request.getParameter("sort_sequence"));
              // connect to database    
              HttpSession session = request.getSession();   
              db.SessionConnection sessConn = (db.SessionConnection) session.getAttribute("connection");
              if (sessConn != null) {
                   try {
                        sessConn.setAutoCommit(false);
                        OracleConnection connection = (OracleConnection)sessConn.getConnection();
                        int lastPosition = getLastNodePosition( getLastChildAttribute(connection, catalogue, parent_attribute) );
                        String newNodeAttribute = createNewNodeAttribute(parent_attribute, lastPosition);
                        // calculate the sequence number
                        int precedingSequenceNumber = getPrecedingSequenceNumber(connection, catalogue, parent_attribute);
                        if ( precedingSequenceNumber == -1 ) {
                             precedingSequenceNumber = parent_sequenceNr;
                        int sortSequence = precedingSequenceNumber + 1;
                        setSequenceNumbers(connection, catalogue, sortSequence);
                        // insert the new node into DB
                        insertNewNode(connection, catalogue, newNodeAttribute, parent_attribute, "Neuer Punkt", sortSequence);
                        connection.commit();
                   } catch(SQLException ex) {
                        ex.printStackTrace();
              return mapping.getForward();
          * Creates, fills and executes a prepared statement to insert a new entry into the specified table, representing
          * a new node in the catalogue.
         private void insertNewNode(OracleConnection connection, String catalogue, String attribute, String parent_attribute, String description, int sortSequence) {
              try {
                   String callAddNode = "{ call fasi_lob.pack_gliederung.addNode(:1, :2, :3, :4, :5) }";
                   CallableStatement cst;
                   cst = connection.prepareCall(callAddNode);
                   cst.setString(1, catalogue);
                   cst.setString(2, attribute);
                   cst.setString(3, parent_attribute);
                   cst.setString(4, description);
                   cst.setInt(5, sortSequence);
                   cst.execute();
                   cst.close();
              } catch (SQLException e1) {
                   // TODO Auto-generated catch block
                   e1.printStackTrace();
    //          String insertNewNode = "INSERT INTO vstd_media_cat_attributes " +
    //                    "(catalogue, attribute, parent_attr, description, sort_sequence) VALUES(:1, :2, :3, :4, :5)";
    //          PreparedStatement insertStmt;
    //          try {
    //               insertStmt = connection.prepareStatement(insertNewNode);
    //               insertStmt.setString(1, catalogue);
    //               insertStmt.setString(2, attribute);
    //               insertStmt.setString(3, parent_attribute);
    //               insertStmt.setString(4, description);
    //               insertStmt.setInt(5, sortSequence);
    //               insertStmt.execute();
    //               insertStmt.close();
    //          } catch (SQLException e) {
    //               e.printStackTrace();
          * This method returns the attribute value of the last child of the parent under which
          * we want to insert a new node. The result set is sorted in descending order and only the
          * first result (that is, the last child under this parent) is fetched.
          * If the parent node has no children, "parent_attr.0" is returned. 
          * @param connection
          * @param catalogue
          * @param parent_attribute
          * @return attribute of the last child under this parent, or "parent_attr.0" if parent has no children
         private String getLastChildAttribute(OracleConnection connection, String catalogue, String parent_attribute) {
              String queryLastChild = "SELECT attribute FROM vstd_media_cat_attributes " +
                                            "WHERE catalogue=:1 AND parent_attr=:2 ORDER BY sort_sequence DESC";
              String lastChildAttribute;
              PreparedStatement ps;
              try {
                   ps = connection.prepareStatement(queryLastChild);
                   ps.setString(1, catalogue);
                   ps.setString(2, parent_attribute);
                   ResultSet rs = ps.executeQuery();
                   /* If a result is returned, the selected parent already has children.
                    * If not set the lastChildAttribute to parent_attr.0
                   if (rs.next()) {
                        lastChildAttribute = rs.getString("attribute");
                   } else {
                        lastChildAttribute = parent_attribute.concat(".0");
                   rs.close();
                   return lastChildAttribute;
              } catch (SQLException e) {
                   e.printStackTrace();
                   return null;
          * This helper method determines the position of the last node in the attribute.
          * i.e for 3.5.2 it returns 2, for 2.1 it returns 1 etc.
          * @param attribute
          * @return position of last node in this attribute
         private int getLastNodePosition(String attribute) {
              StringTokenizer tokenizer = new StringTokenizer(attribute, ".");
              String lastNodePosition = "0";
              while( tokenizer.hasMoreTokens() ) {
                   lastNodePosition = tokenizer.nextToken();
              return Integer.parseInt(lastNodePosition);
          * This method calculates the attribute of a node being inserted
          * by incrementing the last child position by 1 and attaching the
          * incremented position to the parent.
          * @param parent_attr
          * @param lastPosition
          * @return attribute of the new node
         private String createNewNodeAttribute(String parent_attr, int lastPosition) {
              String newPosition = new Integer(lastPosition + 1).toString();
              return parent_attr.concat("." + newPosition);
          * This method checks if the required sequence number for a new node is already in use and
          * handles the sequence numbers accordingly.
          * If the sequence number for a new node is NOT IN USE, the method doesn't do anything.
          * If the sequence number for a new node is IN USE, the method searches for the next free
          * sequence number by incrementing the number by one and repeating the query until no result
          * is found. Then all the sequence numbers between the required number (including, >= relation)
          * and the nearest found free number (not including, < relation) are incremented by 1, as to
          * make space for the new node.
          * @param connection
          * @param catalogue
          * @param newNodeSequenceNumber required sequence number for the new node
         private void setSequenceNumbers(OracleConnection connection, String catalogue, int newNodeSequenceNumber) {
              // 1. check if the new sequence number exists - if no do nothing
              // if yes - increment by one and see if exists
              //           repeat until free sequence number exists
              // when found increment all sequence numbers freeSeqNr > seqNr >= newSeqNr
              String query = "SELECT sort_sequence FROM vstd_media_cat_attributes " +
                        "WHERE catalogue=:1 AND sort_sequence=:2";
              PreparedStatement ps;
              try {
                   ps = connection.prepareStatement(query);
                   ps.setString(1, catalogue);
                   ps.setInt(2, newNodeSequenceNumber);               
                   ResultSet rs = ps.executeQuery();
                   // if no result, the required sequence number is free - nothing to do
                   if( rs.next() ) {
                        int freeSequenceNumber = newNodeSequenceNumber;
                        do {
                             ps.setString(1, catalogue);
                             ps.setInt(2, freeSequenceNumber++);
                             rs = ps.executeQuery();
                        } while( rs.next() );
                        // increment sequence numbers - call stored procedure
                        String callUpdateSeqeunceNrs = "{ call fasi_lob.pack_gliederung.updateSeqNumbers(:1, :2, :3) }";
                        CallableStatement cst = connection.prepareCall(callUpdateSeqeunceNrs);
                        cst.setString(1, catalogue);
                        cst.setInt(2, newNodeSequenceNumber);
                        cst.setInt(3, freeSequenceNumber);
                        cst.execute();
                        cst.close();
    //                    String query2 = "UPDATE vstd_media_cat_attributes " +
    //                                      "SET sort_sequence = (sort_sequence + 1 ) " +
    //                                      "WHERE catalogue=:1 sort_sequnce >=:2 AND sort_sequence <:3";
    //                    PreparedStatement ps2;
    //                    ps2 = connection.prepareStatement(query2);
    //                    ps2.setString(1, catalogue);
    //                    ps2.setInt(2, newNodeSequenceNumber);
    //                    ps2.setInt(3, freeSequenceNumber);
    //                    ps.executeUpdate();
    //                    ps.close();
                   } // end of if block
                   rs.close();
              } catch (SQLException e) {
                   e.printStackTrace();
          * This method finds the last sequence number preceding the sequence number of a node
          * that is going to be inserted. The preceding sequence number is required to calculate
          * the sequence number of the new node.
          * We perform a hierarchical query starting from the parent node: if a result is returned,
          * we assign the parent's farthest descendant's node sequence number; if no result
          * is returned, we assign the parent's sequence number.
          * @param connection
          * @param catalogue
          * @param parent_attr parent attribute of the new node
          * @return
         private int getPrecedingSequenceNumber(OracleConnection connection, String catalogue, String parent_attr) {
              int sequenceNumber = 0;
              String query = "SELECT sort_sequence FROM vstd_media_cat_attributes " +
                                "WHERE catalogue=:1 " +
                                "CONNECT BY PRIOR attribute = parent_attr START WITH parent_attr=:2 " +
                                "ORDER BY sort_sequence DESC";
              try {
                   PreparedStatement ps = connection.prepareStatement(query);
                   ps.setString(1, catalogue);
                   ps.setString(2, parent_attr);
                   ResultSet rs = ps.executeQuery();
                   if ( rs.next() ) {
                        sequenceNumber = rs.getInt("sort_sequence");
                   } else {
                        // TODO: ggf fetch from request!
                        sequenceNumber = -1;
                   rs.close();
                   ps.close();
              } catch (SQLException e) {
                   e.printStackTrace();
              return sequenceNumber;
    }

    After further googling I figured out what was causing the problem: in eclipse I was referring to external libraries located in eclipse/plugins directory, whereas Tomcat was referring to the same libraries (possibly older versions) in it's common/lib directory.

  • Java function call from Trigger in Oracle

    Moderator edit:
    This post was branched from an eleven-year-old long dead thread
    Java function call from Trigger in Oracle
    @ user 861498,
    For the future, if a forum discussion is more than (let's say) a month old, NEVER resurrect it to append your new issue. Always start a new thread. Feel free to include a link to that old discussion if you think it might be relevant.
    Also, ALWAYS use code tags as is described in the forum FAQ that is linked at the upper corner of e\very page. Your formulae will be so very much more readable.
    {end of edit, what follows is their posting}
    I am attempting to do a similar function, however everything is loaded, written, compiled and resolved correct, however, nothing is happening. No errors or anything. Would I have a permission issue or something?
    My code is the following, (the last four lines of java code is meant to do activate a particular badge which will later be dynamic)
    Trigger:
    CREATE OR REPLACE PROCEDURE java_contact_t4 (member_id_in NUMBER)
    IS LANGUAGE JAVA
    NAME 'ThrowAnError.contactTrigger(java.lang.Integer)';
    Java:
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "ThrowAnError" AS
    // Required class libraries.
    import java.sql.*;
    import oracle.jdbc.driver.*;
    import com.ekahau.common.sdk.*;
    import com.ekahau.engine.sdk.*;
    // Define class.
    public class ThrowAnError {
    // Connect and verify new insert would be a duplicate.
    public static void contactTrigger(Integer memberID) throws Exception {
    String badgeId;
    // Create a Java 5 and Oracle 11g connection.
    Connection conn = DriverManager.getConnection("jdbc:default:connection:");
    // Create a prepared statement that accepts binding a number.
    PreparedStatement ps = conn.prepareStatement("SELECT \"Note\" " +
    "FROM Users " +
    "WHERE \"User\" = ? ");
    // Bind the local variable to the statement placeholder.
    ps.setInt(1, memberID);
    // Execute query and check if there is a second value.
    ResultSet rs = ps.executeQuery();
    while (rs.next()) {
    badgeId = rs.getString("Note");
    // Clean up resources.
    rs.close();
    ps.close();
    conn.close();
    // davids badge is 105463705637
    EConnection mEngineConnection = new econnection("10.25.10.5",8550);
    mEngineConnection.setUserCredentials("choff", "badge00");
    mEngineConnection.call("/epe/cfg/tagcommandadd?tagid=105463705637&cmd=mmt%203");
    mEngineConnection.call("/epe/msg/tagsendmsg?tagid=105463705637&messagetype=instant&message=Hello%20World%20from%20Axium-Oracle");
    Edited by: rukbat on May 31, 2011 1:12 PM

    To followup on the posting:
    Okay, being a oracle noob, I didn't know I needed to tell anything to get the java error messages out to the console
    Having figured that out on my own, I minified my code to just run the one line of code:
    // Required class libraries.
      import java.sql.*;
      import oracle.jdbc.driver.*;
      import com.ekahau.common.sdk.*;
      import com.ekahau.engine.sdk.*;
      // Define class.
      public class ThrowAnError {
         public static void testEkahau(Integer memberID) throws Exception {
         try {
              EConnection mEngineConnection = new EConnection("10.25.10.5",8550);
         } catch (Throwable e) {
              System.out.println("got an error");
              e.printStackTrace();
    }So, after the following:
    SQL> {as sysdba on another command prompt} exec dbms_java.grant_permission('AXIUM',"SYS:java.util.PropertyPermission','javax.security.auth.usersubjectCredsOnly','write');
    and the following as the user
    SQL> set serveroutput on
    SQL> exec dbms_java.set_output(10000);
    I run the procedure and receive the following message.
    SQL> call java_contact_t4(801);
    got an error
    java.lang.NoClassDefFoundError
         at ThrowAnError.testEkahau(ThrowAnError:13)
    Call completed.
    NoClassDefFoundError tells me that it can't find the jar file to run my call to EConnection.
    Now, I've notice when I loaded the sdk jar file, it skipped some classes it contained:
    c:\Users\me\Documents>loadjava -r -f -v -r "axium/-----@axaxiumtrain" ekahau-engine-sdk.jar
    arguments: '-u' 'axium/***@axaxiumtrain' '-r' '-f' '-v' 'ekahau-engine-sdk.jar'
    creating : resource META-INF/MANIFEST.MF
    loading : resource META-INF/MANIFEST.MF
    creating : class com/ekahau/common/sdk/EConnection
    loading : class com/ekahau/common/sdk/EConnection
    creating : class com/ekahau/common/sdk/EErrorCodes
    loading : class com/ekahau/common/sdk/EErrorCodes
    skipping : resource META-INF/MANIFEST.MF
    resolving: class com/ekahau/common/sdk/EConnection
    skipping : class com/ekahau/common/sdk/EErrorCodes
    skipping : class com/ekahau/common/sdk/EException
    skipping : class com/ekahau/common/sdk/EMsg$EMSGIterator
    skipping : class com/ekahau/common/sdk/EMsg
    skipping : class com/ekahau/common/sdk/EMsgEncoder
    skipping : class com/ekahau/common/sdk/EMsgKeyValueParser
    skipping : class com/ekahau/common/sdk/EMsgProperty
    resolving: class com/ekahau/engine/sdk/impl/LocationImpl
    skipping : class com/ekahau/engine/sdk/status/IStatusListener
    skipping : class com/ekahau/engine/sdk/status/StatusChangeEntry
    Classes Loaded: 114
    Resources Loaded: 1
    Sources Loaded: 0
    Published Interfaces: 0
    Classes generated: 0
    Classes skipped: 0
    Synonyms Created: 0
    Errors: 0
    .... with no explanation.
    Can anyone tell me why it would skip resolving a class? Especially after I use the -r flag to have loadjava resolve it upon loading.
    How do i get it to resolve the entire jar file?
    Edited by: themadprogrammer on Aug 5, 2011 7:15 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:21 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:22 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:23 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:26 AM

  • I want to call External Java class from the PL/SQL

    Hi,
    I am using Oracle Apps R11i (11.5.7), I wanted to call external Java class from the PL/SQL. This external Java class is residing in another application server.
    How do I do this.
    I know one way. Develop C routine in Oracle Apps to call external java class and call this C routine from the PL/SQL.
    Is there any simple method available? or any other method?
    Thanks in advance.
    -Venkat

    First of all, this is a Java application you're talking about, right (i.e. it has a main() function)? It's not just a class that you're trying to instantiate is it? If it's an application, you obviously have to start a new virtual machine to run it (rather than using the virtual machine built into the database like stored java). I'm a little leary of your mention of an "application server" as this would more commonly mean that a virtual machine is already over there running with access to this class. In which case, you'd typically interface with SOAP or some other RPC API.
    All that aside, as long as you have physical disc access (through NFS or whatever) to the class file, you could use a java wrapper class with a system call to do this. In fact, there is a thread in just the last day or so on this very forum that has the code to do just that (see " Invoking OS Commands from PL/SQL"). However, it's worth noting that the virtual machine will be running on the database server in this case and not the application server.

  • Illegal use of nonvirtual function call

    I'm trying to run this program....
    import java.io.*;
    import java.util.*;
    import java.util.Properties;
    import javax.mail.*;
    import javax.mail.internet.*;
    import sun.net.nntp.*;
    import lotus.domino.*;
    public class WriteNewsFile implements Constants{
         private Store store;
         private Database db;
    public Store createNNTPConnection(String host, String protocol) throws Exception{
    // Create empty properties
    Properties props = new Properties();
    // Get session
    javax.mail.Session session = javax.mail.Session.getInstance(props, null);
    // Get the store
    Store store = session.getStore(protocol);
    store.connect(host, null, null);
    return store;
    public Vector getForumNames(String root) throws Exception {
    Vector result = new Vector();
    NntpClient nc = new NntpClient(NNTP_HOST);
    String line;
    nc.serverOutput.println(NNTP_COMMAND_LIST_ACTIVE);
    BufferedReader br = new BufferedReader(new InputStreamReader(nc.serverInput));
    while ((line = br.readLine()) != null) {
    if (line.equals("."))
    break;
    if (line.startsWith(root)) {
    result.add(line.substring(0, line.indexOf(" ")));
    nc.closeServer();
    return result;
    private void init(String root) throws Exception {
    Vector forums = getForumNames(root);
    for (Enumeration e = forums.elements(); e.hasMoreElements();) {
         System.out.println(readWriteNewsgroup((String)e.nextElement()));
         System.gc();
    public static void main(String args[]) {
         WriteNewsFile wns = new WriteNewsFile();
         try{
              wns.db = wns.openNotesDB(DOMINO_HOST, DOMINO_USER, DOMINO_PASSWD,
    DOMINO_DB);
              wns.store = wns.createNNTPConnection(NNTP_HOST, NNTP);     
              //wns.init("forums.software.");
              wns.init("forums.hardware.");
              //wns.init("forums.services.");
              wns.store.close();
         }catch(Exception e){
              e.printStackTrace();
    * Insert the method's description here.
    * Creation date: (12/10/2001 9:51:20 AM)
    * @param s java.lang.String
    public Database openNotesDB(String host, String user, String passwd, String dbName) throws
    NotesException {
    lotus.domino.Session session =
    NotesFactory.createSession(host, user, passwd);
    db = session.getDatabase(session.getServerName(), dbName);
    if (db == null)
         throw new NotesException();
    else
         return db;
    public String readWriteNewsgroup(String newsgroup) throws Exception {
    // Get folder
    Folder folder = store.getFolder(newsgroup);
    folder.open(Folder.READ_ONLY);
    // Get directory
    Message messages[] = folder.getMessages();
    for (int i = 0, n = messages.length; i < n; i++) {
    //System.out.println( i + ": " + messages.getFrom()[0] + "\t" +
    messages[i].getSubject());
    Document doc = db.createDocument();
    doc.replaceItemValue(MESSAGE_NUMBER,new Integer(messages[i].getMessageNumber()));
    doc.replaceItemValue(MESSAGE_ID, messages[i].getHeader(MESSAGE_ID)[0]);
    doc.replaceItemValue(DATE, messages[i].getReceivedDate());
    doc.replaceItemValue(FROM, messages[i].getFrom()[0].toString());
    doc.replaceItemValue(SUBJECT, messages[i].getSubject());
    doc.replaceItemValue(NEWSGROUPS, messages[i].getHeader(NEWSGROUPS)[0]);
    doc.replaceItemValue(ORGANIZATION, messages[i].getHeader(ORGANIZATION)[0]);
    RichTextItem rtitem = doc.createRichTextItem(BODY);
    try{
         rtitem.appendText(messages[i].getContent().toString());
    }catch(UnsupportedEncodingException e){
                   System.out.println("Could not convert body to String");
    //rtitem.recycle();                                   
    if (!doc.save())
    System.out.println("Did not save the document");      
    // Close connections and files
    folder.close(false);
    return newsgroup;
    but getting this runtime error.....
    C:\$user\java>java WriteNewsFile
    Exception in thread "main" java.lang.VerifyError: (class: com/ibm/CORBA/iiop/Gen
    ericServerSC, method: dispatch signature: (Lcom/ibm/CORBA/iiop/IIOPInputStream;L
    com/ibm/CORBA/iiop/IIOPOutputStream;)V) Illegal use of nonvirtual function call
    at java.lang.Class.forName1(Native Method)
    at java.lang.Class.forName(Class.java:134)
    at com.ibm.CORBA.iiop.ORB.registerSubcontracts(ORB.java)
    at com.ibm.CORBA.iiop.ORB.<init>(ORB.java)
    at java.lang.Class.newInstance0(Native Method)
    at java.lang.Class.newInstance(Class.java:254)
    at org.omg.CORBA.ORB.create_impl(ORB.java:306)
    at org.omg.CORBA.ORB.init(ORB.java:355)
    at lotus.domino.cso.Session.OREFtoSession(Session.java:703)
    at lotus.domino.cso.Session.<init>(Session.java:57)
    at lotus.domino.cso.Session.createSession(Session.java:36)
    at lotus.domino.NotesFactory.createSession(NotesFactory.java:67)
    at WriteNewsFile.openNotesDB(WriteNewsFile.java:88)
    at WriteNewsFile.main(WriteNewsFile.java:66)
    and don't understand the nature of the error...... Can anyone help or direct me to some information that might help me understand?
    Thanks,
    Heather

    you have used a method that was implemented in JRE1.2 -- IE's native JVM 1.1.4 or 1.1.5 . You can do one of two things:
    1) convert your html file to make it use a new Java plug-in, or
    2) change your code to call a comparble method that is available before 1.2
    V.V.

  • Calling a java class in a JSP file

    Hello,
    I have a jsp file in which I call a java class.
    I work with Tomcat 4.0.1
    If I modify the java class and then I execute my JSP, it still be the old version of my class that is executed.
    I don't understand why since if I creates a main function and I execute it, it works correctly!
    Do you know what is the problem?
    Thanks

    i also have this problem.when i modify jsp file,it didn't execute inmediately. Then i restart tomcat,but problem also exist.
    a few minute age,i execute jsp file again,it can appear the modified jsp.i don't down why
    i work tomcat 5.0 windowxp

  • Applet function call from javascript

    Hi,
    I'm haveing a problem with accesing applet's functions from Javascript in Mozilla. IE works fine but in Mozilla I get the following error:
    Error: document.applets[0] has no properties
    The code used is: document.applets[0].test();
    The applet has the following 2 tags defined, I don't know if they are necessary here but I'm doing the reverse too (applet functions call javascript).
    <PARAM name="MAYSCRIPT" value="Y">
    <PARAM name="SCRIPTABLE" value="Y">
    If you have any ideea please help.
    Thanks

    in javascript try document.getElementById("idOfTheApplet")
    use object tag instead of applet tag:
         <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
                  height="300" width="450" >
            <param name="code" value="appTest.class" />
            <!--[if !IE]> Mozilla/Netscape and its brethren -->
            <object classid="java:appTest.class"
                    height="300" width="450"
                    >
              <param name="mayscript" value=Y" />
            </object>
            <!-- <![endif]-->
          </object>or check out HtmlConverter.exe in the jdk bin dir.

Maybe you are looking for

  • Is there a relationship between InfoPath and the "Solution Approval" and "Solution Unpublish" timer jobs?

    One of our developers has a test SP 2010, service pack 2 system. Against it, he is testing form library InfoPath 2010 applications that he is developing. There are, over the 2 months he has been working, an increasing number of times that the machine

  • This white spots, and a little magenta line

    I noticed recently that I have a couple of those white spots now on the right, center portion of my screen. I have one of the very first Aluminum PowerBook's, I got it in January 2004 immediately after the Titanium's were replaced. It's one slightly

  • Oracle Linux 6 Login

    Hi I installed oracle linux 6 in my machine. After installation, linux is asking user name password. I specified the same password at time of installation, but i dont know the username. Anyone know, using which account I get into login?

  • How do i delete a game demo?

    I downloaded a game demo, and I want to remove it from my mac.  It is located in the launch pad, and I don't know how to get rid of it.

  • TS1398 can i take icloud update off my ipod

    I have updated by ipod touch to include icould + now I cannot connect to the internet - I didn't have this problem before - I have re-set the ipod back to factory settings but icloud is still on - still can't connect to internet/itunes