Call PL/SQL packages in JSP

I would like to call PL/SQL packages in JSP. I am new in Java world. So, kindly tell code about to call packages from oracle. I will be thankful to all those experts who will help a student such as me.
I will be anxious to your response.
plz
plz

Dear sir,
I am really thankful to you. I have to verify password in oracle.
Id and password verification is writting in package's function. Id and password are oracle users. Like scott in Oracle. I think it is possible.
Kindly assist me.
If u feel easy then kindly contact me at [email protected] or tell me your email address. Plz

Similar Messages

  • Issue in Calling PL/SQL packages using callable statement

    Hi ,
    I have the requirement of calling two pl/sql packages , After call of first package is successful , i need to pass the output of that first package as input to second package.
    Since i have called both the packages in same method of AM, first package gets executed successfully but second package doesnt get the input values required from first package and results in error.
    Looks like since commit is happening in the single session second package is passed with NULL values.
    Need suggestion for proper way of calling pl/sql packages when second package is dependant on first one:
    Code used inside AM Method:
    if("PENDING_XXX".equals(regVORow.getRegStatus()))
    regVORow.setRegStatus("VENDOR_CREATED");
    getOADBTransaction().commit();
    OracleCallableStatement cStmt = null;
    OADBTransaction dbTxn = getOADBTransaction();
    NUMBER vendor_id = new NUMBER(-1);
    NUMBER vendor_site_id = new NUMBER(-1);
    int vendor_id_value = -2000;
    String vendor_number = null;
    try
    cStmt = (OracleCallableStatement)dbTxn.createCallableStatement("begin *XXB_POS_PVT.create_vendo*r( p_vendor_name => :1, p_supplier_reg_id => :2, p_vendor_id=>:3); end;", 1);
    cStmt.setString(1, regVORow.getSupplierName());
    cStmt.setNUMBER(2, new Number(Integer.parseInt(supplierId)));
    cStmt.registerOutParameter(3, 4);
    cStmt.execute();
    vendor_id = cStmt.getNUMBER(3);
    vendor_id_value = vendor_id.intValue();
    catch(SQLException e)
    throw new OAException(e.getMessage());
    Number vendorId = new Number(vendor_id_value);
    regVORow.setVendorId(vendorId);
    if(vendorId != null)
    vendor_number = getSupplierVendorNumber(vendorId);
    getOADBTransaction().commit();
    AsiPosSupplierOpCosVOImpl regOpCosVO = (AsiPosSupplierOpCosVOImpl)this.getAsiPosSupplierOpCosVO1();
    AsiPosSupplierOpCosVORowImpl row = null;
    int fetchedRowCount = regOpCosVO.getFetchedRowCount();
    RowSetIterator createIter1 = regOpCosVO.createRowSetIterator("createIter1");
    if(fetchedRowCount > 0)
    createIter1.setRangeStart(0);
    createIter1.setRangeSize(fetchedRowCount);
    for(int i = 0; i < fetchedRowCount; i++)
    row = (AsiPosSupplierOpCosVORowImpl)createIter1.getRowAtRangeIndex(i);
    if(row.getApprovalStatus().equalsIgnoreCase("HEAD_APPROVED"))
    try
    oadbtransactionimpl.writeDiagnostics(this,"Creating Site - " + vendor_id_value+" "+row.getSupplierOpcoCode()+" "+supplierId,1);
    cStmt = (OracleCallableStatement)dbTxn.createCallableStatement("begin *XXB_POS_PVT.create_vendor_sites*(p_supplier_reg_id => :1, p_vendor_id=>:2, p_opco_code=>:3, p_vendor_site_id=>:4); end;", 1);
    cStmt.setNUMBER(1, new Number(Integer.parseInt(supplierId)));
    cStmt.setNUMBER(2, new Number(vendor_id_value));
    cStmt.setString(3,row.getSupplierOpcoCode());
    cStmt.registerOutParameter(4, 4);
    cStmt.execute();
    vendor_site_id = cStmt.getNUMBER(4);
    getOADBTransaction().commit();                                    
    catch(SQLException e)
    throw new OAException(e.getMessage());
    createIter1.closeRowSetIterator();

    Hi ,
    There are some validation that can be performed from Entity level ( EO ) , you can go through them in Jdev guide .
    It depends on the business requirement , not all validation can be performed from Entity level .
    Let us know your business requirement , will try to clear your doubt .
    --Keerthi                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Call pl/sql API from jsp portlets

    HI ALL!
    I need to ask from java developers for portal application,How can i call pl/sql API from my jsp portlets,What enhancements in code should i have to follow in addition to use JDBC,I read in FAQ abt portal some thing abt pl/sql wrapper but that was for complex scenarios ,what if my requirement is to call only API functions for contentareas,items,previleges etc.I really need help.
    thx
    Alizeh

    Hi
    thanks for ur reply but where were u a month ago,i really started to think that my question was enough stupid not to be answered.At present i have done with jdbc and pl/sql calls ,current concern is for sessions as i see that session id remains same when one user logs out and another logs in(if browser is not closed), same sessionid persists in my java portlet for both users.Is this an expected behaviour?? but yes new session id appears if browser is closed.
    .session clear for both application and sso after logout is checked
    .broser is set to check for new version each visit for the page
    portal version is 3.0.9.8.0 ,we r planning patch to 3.0.9.8.3 soon
    once again thx
    Alizeh

  • Calling pl/sql package on different database in process flow

    Hi there
    Have a process flow which calls procedure on different database. This procedure truncates a table on the remote database.
    Please could somebody confirm we would need to set up dblinks from the owf_mgr schema to the remote database.
    New to wokflow - am i Correct in assuming the process flows run on the owf_mgr
    rather than the control center owbrt.
    Many Thanks

    Hi there,
    Thanks for the reply.
    If my understanding is correct I could have a procedure as follows.
    hkeeping.trunc_table@dblinkname('TABLE_NAME');
    Is this the case?
    Another alternative was to call directly the transformation in the process flow
    e.g. we have pl/sql package on remote database whioch truncates the remote table.
    When we try this with same procedure on same databas as owb user exists on then works fine.
    However on remote database get message below. Does this mean anything to you? How could we sort this?
    RPE-01003: An infrastructure condition prevented the request from completing.
      TEMP_PLOW:TRUNC_TABLE
    Error
    RPE-01038: Failed to evaluate expression null. Please modify the expression, redeploy and retry again.
       TEMP_PLOW:TRUNC_TABLE
    Error
    RPE-01003: An infrastructure condition prevented the request from completing.
       TEMP_PLOW:TRUNC_TABLE
    Error
    RPE-02226: Cannot test Control Center user REMOTEUSERNAME. This user must match the login credentials of the deployment location.
       TEMP_PLOW:TRUNC_TABLE
    Error
    ORA-01937: missing or invalid role name
    Many Thanks

  • Calling PL/SQL Package in the same connection

    I have a PL/SQL Package MYPCKG, stored in the database, with a function GETDFLT(). I need it to initiate the default values for fields (Attributes) of an EntityImpl Object (EOImpl) in its create method.
    I used JPublisher to generate a wrapper class of the package, named MyPckg. It has three Constructors: MyPckg (),MyPckg (ConnectionContext c) and MyPckg (Connection c). The problem is that I dont know how to use the existing connection of EntityImpl object (or of ApplicationModuleImpl) to create a new MyPckg object.
    The example below makes a new connection to database:
    public class EOImpl extends oracle.jbo.server.EntityImpl {
    public void create(AttributeList attributeList) {
    Oracle.connect("jdbc:oracle:thin:@host:1521:DB1", "user", "pwd");
    MyPckg dflts = new MyPckg ();
    setField1 (dflts.getDflt ());
    I believed that I can do it through DBTransaction but I couldnt find a relationship between DBTransaction and java.sql.Connection or sqlj.runtime.ConnectionContext.
    In MetaLink, I found a couple of items with the same problem, but they appear not to be answered.
    Thanks in advance
    Mirza
    null

    Thank you very much for replay.
    The suggested technique uses JDBC. In fact, I wanted to use BC4J Entity Object and embedded SQLJ (generated by JPublisher). In the JDeveloper Help Topic Embedding SQL in Java Programs with JDBCstays: JDBC provides Java programs with low-level access to databases. If your application or applet uses purely static SQL, where you know the database schema at compile time, you should consider using SQLJ instead. So what I am looking for is how to get a java.sql.Connection or sqlj.runtime.ConnectionContext or sqlj.runtime.ref.DefaultContext Object from some BC4J Object (ApplicationModule or Entity).
    Thanks in advance
    Mirza

  • How to call PL/SQL function from JSP ?

    We have the JSP application developed using the JDeveloper 3.0. I am trying to call the PL/SQL DB function. I'm trying to use the method of ApplicationModule:
    .getTransaction().executeCommand(sCommand)
    The problem is that I can not get the function result back to JSP. The executeCommand() does not seem to accept any host variables.
    What to do ? Did anyone manage to get the feedback from DB ?
    Here is the code in the JSP page:
    <%! String res=" ";%>
    <jsp:useBean id="rsn"
    class="oracle.jbo.html.databeans.TRSRowSetNavigator"
    scope="request" >
    <%
    rsn.initialize(application,session, request,response,
    out,"theIMO_trs_bc4J_Bc4JModule.AuctionsListView");
    rsn.setReleaseApplicationResources(true);
    // this is the ID to be copied
    String copy_id = request.getParameter(TRS.LOOK_UP_PK_FIELD);
    if( copy_id != null) {
    // call the PL/SQL procedure to create copy of this auction
    String sCommand = "DECLARE a NUMBER; BEGIN :res:=Copy_Auction("
    copy_id"); END;";
    rsn.getRowSet().getApplicationModule().getTransaction().executeCommand(sCommand);
    rsn.getRowSet().getApplicationModule().getTransaction().commit();
    I receive the following error:
    Error Message: JBO-27121: SQL error during statement execution. Statement: DECLARE a NUMBER; BEGIN :res:=Copy_Auction(45); END;
    JBO Error:JBO-27121: SQL error during statement execution. Statement: DECLARE a NUMBER; BEGIN :res:=Copy_Auction(45); END;: ORA-01008: not all variables bound
    What criteria has the host variable meet to be used in the executeCommand(sCommand) method ?
    Thanks,
    Michael
    null

    I could be wrong there, but I have experienced similar problem on tru64 unix, with sticky bit not in place for the following files: $ORACLE_HOME/bin/oracle and $ORACLE_HOME/bin/oracleO. Once you restore those files via tar command (this is what happened to me), the sticky bit disappears, and you have to re-introduce it by issuing unix command: chmod 1777 on those files.
    What it does for you - it allows you to execute the sql statements as an oracle user & group!
    Otherwise, if this bit is lost, whenever you try to connect to sqlplus via user / password it hits you back with:
    ORA-01034 ORACLE not available
    ORA-27121 unable to determine size of shared memory segment
    Compaq Tru64 UNIX Error: 13:Permission denied
    This should not be a problem if you try and execute the same sql statements using listener (connecting to the server by using @ statement).
    I could be late in response to you, but maybe not for other people.

  • Call PL/SQL Package to Create DB User and assign Privileges

    Hi All,
    I'm sure this has been covered before but I couldn't find anything relevant....
    I'm calling a PL/SQL Process from within an Apex (version 2.0) Page, that ultimately Creates a New DB user.
    I am receiving an ORA-01031: insufficient privileges error. My Application User and the Package owner both have privileges to Create a DB user.
    What am I missing?
    Thanks,
    Mike

    Never, ever grant additional privileges to the apex_public_user account. It achieves nothing and makes the account over-privileged. The only privilege it needs is CREATE SESSION.
    Mike - Your application's parsing schema (I assume that's the package owner) needs to be granted privileges directly and not through roles. I don't know what you mean by your application user's privileges. Those users are not database accounts (unless you are using a dedicated DAD, etc.).
    Scott

  • Calling pl/sql function from JSP to get data

    Hi,
    Ideally I want to pass the results of a PL/SQL function or procedure to my JSP page as a resultset or an array.
    I've manage to pass all the data as a string like this:
    // this works for a function that returns a string
    String str;
         CallableStatement cstmt = conn.prepareCall("begin ?:= temp_package.pass_string(); end;");
         cstmt.registerOutParameter(1,Types.VARCHAR);
         cstmt.execute();
         str = cstmt.getString(1);
    but if I try to pass a collection or Varray or Ref Cursor like this:
    // LETS TRY A PROCEDURE THAT ALTERS THE CONTENTS OF AN ARRAY
         CallableStatement cstmt = conn.prepareCall(" begin ?:= temp_package.pass_varray(); end;");
         cstmt.registerOutParameter(1,Types.ARRAY);
         cstmt.execute();
    or this:
    CallableStatement cstmt = conn.prepareCall(" begin ?:= temp_package.pass_cursor(); end;");
         cstmt.registerOutParameter(1,Types.CURSOR);
         cstmt.execute();
    or this:
    CallableStatement cstmt = conn.prepareCall(" begin ?:= temp_package.pass_cursor(); end;");
         cstmt.registerOutParameter(1,OracleTypes.CURSOR);
         cstmt.execute();
    I get an error saying that the type can�t be translated or something similar. It seems happy with VARCHAR but not with ARRAY,VARRAY or CURSOR.
    Can anyone help please as this has driven me crazy for hours surfing google and various forums. Thanks.

    Ok, I made the changes, but I'm now getting the following error:
    Error code = 1403
    Error message = ORA-01403: no data found
    ORA-06512: at "IOBOARD.GETSTATUS", line 6
    ORA-06512: at line 1
    The ora-01403 I don't understand because there is data for the name Kelly.Brace.
    ora-06512 error: at string line string.
    Here's what the code looks like after I made the changes:
    String sql = "{?=call ioboard.GetStatus(?)}";
          // create a Statement object
          myStatement = myConnection.prepareCall( sql );
          myStatement.setString( 1, "Kelly.Brace" );
          myStatement.registerOutParameter(2, java.sql.Types.LONGVARCHAR );
          // create a ResultSet object, and populate it with the
          // result of a SELECT statement
          ResultSet myResultSet = myStatement.executeQuery();
          // retrieve the row from the ResultSet using the
          // next() method
          myResultSet.next();
          // retrieve the user from the row in the ResultSet using the
          // getString() method
          String status = myResultSet.getString(1);
          System.out.println("Hello Kelly, your status is: " + status);
          // close this ResultSet object using the close() method
          myResultSet.close();Here's what the function looks like:
    CREATE OR REPLACE FUNCTION GetStatus( user_name in varchar2)
    RETURN VARCHAR2
    is
    v_status varchar2(10);
    BEGIN
    select iob_location into v_status
    from ioboard.iob_user
    where iob_username = user_name;
      RETURN( v_status);
    END;This works perfectly in the SQL Window:
    select iob_location
    from ioboard.iob_user
    where iob_username = 'Kelly.Brace';

  • Calling pl/sql procedure from jsp

    Hi:
    Could anyone tell me how to call a pl/sql procedure from a jsp page by passing args or without . Is there any specific method to use.
    Thanks.

    Like from any other java code
    <%
    Connection conn = DriverManager.getConnection(...);
    CallableStatement cs = conn.prepareCall("BEGIN myprocedure(); END;");
    cs.execute();
    %>
    With params:
    <%
    Connection conn = DriverManager.getConnection(...);
    CallableStatement cs = conn.prepareCall("BEGIN myprocedure(?, ?); END;");
    cs.setInt(1, 10);
    cs.setString(2,"aaaa");
    cs.execute();
    %>
    to return some value as out param
    Connection conn = DriverManager.getConnection(...);
    CallableStatement cs = conn.prepareCall("BEGIN myprocedure(?, ?, 3); END;");
    cs.setInt(1, 10);
    cs.setString(2,"aaaa");
    cs.registerOutParameter(3, Types.VARCHAR);
    cs.execute();
    out.println("Returned value: " + cs.getString(3));
    %>
    Of course after all close statement and connection to free resources.

  • Calling PL/SQL-package, returning PL/SQL-table

    Hi,
    I'm trying to call a PL/SQL-function returning a PL/SQL-table with two numbers. The below code gives me the cryptic error 'Invalid column index'. Does anyone know how to do this ? I want to display tab_innlogginger (1) and tab_innlogginger (2) in the report...
    <dataSet id="Innlogginger">
    <sql dataSourceRef="DWH-PL">
    <![CDATA[
    declare
    tab_innlogginger dwh_lib.tabdef_innlogginger;
    begin
    tab_innlogginger := dwh_lib.tellinnlogginger (:l_fra_dato, :l_til_dato);
    end
    ]]>
    </sql>
    <input id="l_fra_dato" value="${l_fra_dato}" dataType="xsd:date"/>
    <input id="l_til_dato" value="${l_til_dato}" dataType="xsd:date"/>
    </dataSet>
    The dwh_lib.tabdef_innlogginger is defined as:
    type tabdef_innlogginger is table of number index by binary_integer;
    Regards
    Erik

    OK, found something here:
    Re: steps to create BI publisher report through oracle stored procedure
    Seems pipelined functions using Oracle-objects should work.

  • ORA-00904 OCCURS WHEN CALLING PL/SQL PACKAGED FUNCTIONS

    Hi ,
    When i try to execute
    SELECT P_GMT_FOLDER.F_GET_SEC_MTRTY_BUCKET(TO_DATE('16/04/2008','DD/MM/YYYY'),TO_DATE('16/04/2008','DD/MM/YYYY'))
              FROM DUAL
    it showing the error like in Production
    ORA-00904 invalid identifier.
    But in UAT is is working fine.
    Could anyone tell me how to fix this?
    Cheers
    Ramkannan.A

    lol!
    I'd like to say that I'd join you, but I'm sure someone would misconstrue that!
    *{;-)                                                                                                                                                                                           

  • Calling SQL packages from java

    How do I call ORACLE sql packages from java?
    We are still using Oracle 7.3. Any sample code
    would be appreciated.

    utility.processPLSQL( connRisk,
    " Begin "
    + " hvar_sum.p_load_var_summary_data("
    + " '" + dfCall.format( priceDate ) + "', "
    + " '" + promptMonth + "',"
    + daysBack + ","
    + aliasType + ","
    + "'" + connRisk.owner + "'"
    + "); "
    + " end ; ",
    "Load VaR Summary Data",
    utility.noLogMsg ) ;
    public boolean processPLSQL(
    MyConnection conn,
    String sql,
    String dataType,
    boolean createLogMessage ) {
    double startTime = conn.log.getStartTime() ;
    try {
    CallableStatement cs = conn.theConnection.prepareCall(sql);
    cs.execute() ;
    cs.close() ;
    conn.theConnection.commit();
    if ( createLogMessage ) conn.log.logTiming( dataType, startTime ) ;
    } catch ( SQLException e ) {
    conn.log.logError( "Utility.processPLSQL; SQLException Error: " + e ) ;
    System.out.println(new java.util.Date().toString() + "; User: " + conn.user
    + "; SQL: " + sql );
    return false ;
    return true ;
    }

  • Calling User written pl/sql Packages from forms 9ias

    I want to call Pl/sql package (my own) from forms 9ias.
    Actaully i am upgrading my application forms 6i to 9ias forms.
    Please suggest me a solution.

    Same way as 6i. What is the problem ?

  • Generating Java wrappers for PL/SQL Packages in JDeveloper 3.1

    I have not been successful in using JD3.1 to generate java classes for use in calling PL/SQL packages from a Java Servlet I am developing. I have followed the directions under the 'Generating Java Code for Oracle Objects and PL/SQL Packages' help topic: I display the package in the database browser window, right click on the package, select 'Generate Java', and click 'OK' on the pop-up JPublisher window that appears. The wizard clocks out for a few moments, then the JPublisher window disappears, but the java class is not added to JDeveloper's Navigation pane for the Project and Package I specified in the wizard.
    Any idea where the generated class is going to?

    should be, but isn't... JDeveloper3.1
    (build 681) default install... Is it in
    a custom package I didn't install? Or
    am I just a dumb nut?Hmm.. I thought it was in there.. JPub is a java based tool. You can invoke it as such.
    1st, use setvars.bat from your jdeveloper/bin directory.
    2nd, run java oracle.jpub.java.Main (pass it the same arguments as you would the jpub.exe)
    Here's the output from my machine here:
    D:\JDeveloper31\bin>setvars D:\JDeveloper31
    Setting JDeveloper 1.2 runtime environment to "D:\JDeveloper31"
    Setting JDK version 1.2 in "D:\JDeveloper31\java1.2"
    D:\JDeveloper31\bin>java oracle.jpub.java.Main
    JPub: Java Object Type Publisher, version 8.1.6.0.0 Production
    (and the rest of the help)
    Take Care,
    Rob
    null

  • ESB cannot find SQL package

    Hey I have an ESB service which calls a DBadaptor which calls a SQL package, but for some reason it cannot find the package at runtime.

    Some more information would be really handy.
    - Did it work in the first place?
    - Did you deploy to another environment?
    - Are there other people working in the same environment? e.g. Did someone remove something you are not aware of?
    - Did you check the various logfiles for errors. What errors are you receiving?
    - When you login to the database with e.g. SQL Developer. Can you actually find the Object in the first place?
    etc :-).
    More information would really be appreciated :-)

Maybe you are looking for

  • Broadcast quality media converter.. Any suggestions?

    I'm in the market for a fw media conveter that can handle SDI, Analog Component, composite, and S-Video as well as balanced audio, genlock, and RS422 control. My main editing system is FCP on a G4 editing 8-bit uncompressed, but I'm looking to turn a

  • Problems with non-ASCII characters on Linux Unit Test Import

    I found a problem with non-ASCII characters in the Unit Test Import for Linux.  This problem does not appear in the Unit Test Import for Windows. I have attached a Unit Test export called PROC1.XML  It tests a procedure that is included in another at

  • Compare two schemas in oracle 11g

    Hi All, Can any one please help me how to compare two schemas in oracle 11g. Thanks Edited by: 793914 on Oct 22, 2010 9:33 AM

  • Drag & drop

    I am doing a project for quiz. in that quiz, there are 3 stages. The final one is drag & drop . The target and drop are dynamic text boxes . But it doesn't match with its target perfectly

  • IPod Nano repeats song endlessly. Is this a setting I've overlooked

    My Nano continually repeats a song until I use the 'next song' button. Ii this a setting I've overlooked? I find no reference to this in the manual