Read item from Java class and call to stored function/procedure of database

Hi,
I am looking solution that I was trying to find becasue of I am not expert and novice of ADF so I am getting problem to do. I am trying migrating from oracle forms to JDeveloper[ADF].
I want to call database stored function from JSF pages by java bean class of a button press event (manually created) and after button event I have called java class which I created manually. But I can not read that values what I given into jsp page.
question1: How can I read jsp pages items value to java class ?
question2: How can I call to database stored function/procedure with that parameter?
question3: How can I use return value of that stored function/procedure ?
Please reply me .
Thanks,
zakir
===
Edited by: Zakir Hossain on Mar 29, 2009 10:22 AM

---

Similar Messages

  • Output from java class and display

    I have a big output from a java class after executing a java class... where can store that huge output before I <cflocation to the same page? I need to display the output to the user on the relocated page...Any help appreciated...

    cfsavecontent to a session variable.

  • JSPs and calling a DB function/procedure

    I looked at an example written by Oracle and I saw that they put in the <form> tag (in a JSP) an "action" that is really a name of a DB procedure. It was in the form of:
    schemaName.packageName.procedureName
    First: I've tried to do that myself -- just create simple HTML page, have an <input> with the "type" of "text", and in the <form>'s action put the procedure's full 'path' name. Did not work. Am I missing anything? What's the right way to do it?
    What I see in the browser's URL is:
    "http://serverName:portNum/.../pls/portal30/PORTAL30.MYPACKAGE.MYPROCEDURE?" But I see an empty page.
    Second: looking at the actual procedure body of the example, I saw that the procedure's parameters are given the same exact name as the names of the <input>'s in the JSP page. Like:
    <input type="text" name="txtFirstName">
    and in the procedure:
    someProcedureName(txtFirstName integer)
    Is that the way to pass parameters to a DB procedure? (by using the same name)
    Third: Can I call a DB function from a JSP's <form>'s "action" and get the return value somehow? Meaning, I want to know whether the function's operation was successful and no exceptions were thrown. And if there were some exceptions thrown, I want to let the user know somehow.... How?
    A lot of questions, I know, but I still gotta know... :-)
    Thanks!
    Dan

    Dan,
    Sorry for the late answer, hope it's not too late yet.
    1) If you make your DB procudures accessible from a plain browser, you can obviously define that URL as an html form action. Make sure that your procedures are accessible when typing in the URL in your browser. You need to check whether you have privileges to access the procedure, and the DAD settings too.How do I make my DB procedures accessible from a plain browser?
    Is just making a "GRANT" to that procedure to that user enough? And what do I need to do with the DAD?
    Is the "?" question mark in your URL, or has it been added by the forum only? You don't need it as long as you don't want to pass parameters.Question mark was added by the browser..
    3) I'd probably do it through passing the error code to the JSP as a parameter. You find information about reading parameters in the PDK. Yes, but how do I pass it BACK to the browser? I do know how to pass parameters to a "regular" JSP (one that has nothing to do with the portal). But this one involves the DB -- how do I tell my DB function to send an "answer" back to the browser? It would send the function's return value straight to the browser because the browser was the thing that called it in the first place?
    Dan

  • How i can set dropDown item to 6th item from java code ?

    Hi
    Thank you for reading my post.
    how i can set dropDown item to 6th item from java code ?
    i have the value field of database and i can use it to set selected item of DropDown.
    so : can i use value field to set the selected item ?
    Thank u.

    Hi,
    Please go through the following thread which discusses about setting teh selected item for a dropdown:
    http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=50697
    Hope it helps
    Cheers
    Giri

  • Reading items from a list view in SharePoint 2013

    I am trying to read items from a Calendar, and have created a view that contains all the items/events that I would like to retrieve to package in a CSV file, specifically the Title, Description, and the Start and End Dates.
    The problem with some events is that they are recurring, and rather than use CAML to expand the events and try to query it that way, I thought it would be more elegant to just get the events from the view, and package them with a simpler query.
    The problem I am running in to is that I can reference the entire list and package the data, or I can reference the list and get all the data in a specific date range, which does not include the recurring events, but I cannot simply read the data from the
    view.
    Any pointers would be greatly appreciated. Also, can you recommend any complete-ish texts on PowerShell with SharePoint?

    Hi,
    Based on my understanding, as there is no straight way of using CAML to query all the events(specially for instances of recurring events) by a list view, I would suggest
    you separately query the instances of recurring events needed.
    A code demo(though in C#) about
    how to query events(include recurring events) from Calendar list in this thread for your reference:
    http://social.technet.microsoft.com/Forums/en-US/99c3ded6-a8cb-4509-9a74-e93e445d78c7/how-does-calender-list-daterangesoverlap-todaymonthyear-and-week-exactly-work?forum=sharepointdevelopmentprevious
    About
    how to export to CSV file:
    http://www.codeproject.com/Articles/667269/Export-To-CSV-file
    http://www.codeproject.com/Articles/685310/Simple-and-fast-CSV-library-in-Csharp
    How to export to CSV file using PowerShell:
    http://shaiknb.wordpress.com/2013/05/27/powershell-sharepoint-export-list-items-via-view-to-csv/
    http://meandmysharepoint.blogspot.com/2012/08/export-sharepoint-list-data-into-csv.html
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they
    help and unmark them if they provide no help. If you have feedback for TechNet
    Subscriber Support, contact [email protected]
    Patrick Liang
    TechNet Community Support

  • Call Java Class and Methods from ABAP

    Hi
    I install de JCo, But how i can call java class and methods from ABAP?. somebody has an example?
    The tutorial say that's is possible,  but don't explain how do that?
    Thanks.
    Angel G. Hurtado

    If you need only simple java program, you do not need to install JCo. The following codes can call java class.
    DATA: COMMAND TYPE STRING VALUE 'C:\j2sdk1.4.2_08\bin\java',
          DIR TYPE STRING VALUE D:\eclipse\workspace',
          PARAMETER TYPE STRING VALUE 'Helloworld'. "here the name of your java program
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
       EXPORTING
         APPLICATION = COMMAND
         PARAMETER = PARAMETER
         DEFAULT_DIRECTORY = DIR
       MAXIMIZED =
         MINIMIZED = 'X'     "If you need the DOS window to be minimized
      EXCEPTIONS
        CNTL_ERROR = 1
        ERROR_NO_GUI = 2
        BAD_PARAMETER = 3
        FILE_NOT_FOUND = 4
        PATH_NOT_FOUND = 5
        FILE_EXTENSION_UNKNOWN = 6
        ERROR_EXECUTE_FAILED = 7
        OTHERS = 8.
    Tell me if it works.
    Nuno.

  • Calling Servlet from Java Class in eclipse

    Hi ,
    I am calling a Servlet from JAVA Class as I am using IDE: Eclipse. The Problem is below
    URL url = new URL(ServletPath);
    URLConnection connet = url.openConnection();
    I am using the above code in JAVA to Connect to Servlet I have given Print statement in Servlet such that whenever it calls it prints on Console but when I try to run the code the Statement is not printed in the Console of eclipse I think URL connection is not able to establish any connection ..... if any has solution for this please reply
    Thanks & Regards,
    Arvind

    I am calling a Servlet from JAVA Class as I am using IDE: Eclipse. The Problem is below
    URL url = new URL(ServletPath);
    URLConnection connet = url.openConnection();Why should the Servlet running in different Runtime print on your Eclipse Runtime. Please be more clear about the question.

  • Calling OAM WLST Commands from java class

    Hi all,
    is there any idea how to call OAM related WLST commands from java class ?.
    what are the required jar files ?
    thanks

    Hi,
    As per my understanding in OAM you will have only two major .py file startscript.py and stopscript.py file which will start nodemanger connect and start Admin and managed server similarly in stop it will stop managed server Admin server and then last nodemanager.
    these all done through wlst command using nmConnect(), nmStart (), nmKill() and shutdown etc.
    What exactly you are looking to get from java code.
    Regards,
    kal

  • WCF Service and Sharepoint Form library : How i can read a access a form libray and query a item from file name and read form xml in WCF service ?

    WCF Service and Sharepoint Form library : How i can read or access a form libray and query a item from file name and read form xml in WCF service ?
    Ahsan Ranjha

    Hi,
    In SharePoint 2013, we can take use of REST API or Client Object Model to access the SharePoint objects like Form Library.
    SharePoint 2013 REST API
    http://msdn.microsoft.com/en-us/library/office/dn450841(v=office.15).aspx
    http://blogs.technet.com/b/fromthefield/archive/2013/09/05/working-with-sharepoint-list-data-odata-rest-and-javascript.aspx
    SharePoint 2013 Client Object Model
    http://msdn.microsoft.com/en-us/library/office/fp179912(v=office.15).aspx
    http://msdn.microsoft.com/en-us/library/office/jj193041(v=office.15).aspx
    With the retrieved file, we can then use XmlDocument object to parse it and get the values you want:
    http://weblogs.asp.net/jimjackson/opening-and-reading-an-xml-file-in-a-document-library
    http://stackoverflow.com/questions/1968809/programatically-edit-infopath-form-fields
    Best regards
    Patrick Liang
    TechNet Community Support

  • How to remove item from my iPhone and iPad on my reading list?

    How to remove item from my iPhone and iPad on my reading list?

    Swipe across its name in the list and it should get a Delete button on it - tap that and it should be removed from the list

  • Only to import  JAVA CLASS  and JAVA SOURCE  from .DMP file using IMPDP

    hi,
    I have a schema X, In that schema some of the *"JAVA CLASS" and "JAVA SOURCE"* objects are missing ..
    The procedures ,functions..etc objects were updated at X schema..
    I have 1 dmp file of Y schema , containing the missing "JAVA CLASS" and "JAVA SOURCE" s.. Can I import the the same to the schema X using IMPDP
    i tried using INCLUDE clause but it is not working
    eg:
    impdp john1/john1@me11g22 directory=datadump dumpfile=DEVF2WAR.DMP remap_schema=devf2war:john INCLUDE="JAVA CLASS","JAVA CLASS"but error..
    ORA-39001: invalid argument value
    ORA-39041: Filter  "INCLUDE" either identifies all object types or no object types.regards,
    jp

    Double post: IMPDP to import  JAVA CLASS  and JAVA SOURCE from .DMP file
    Already replied.
    Regards
    Gokhan

  • XFIRE - Java class from wsdl and soap request from java class

    Hi,
    Firstly i'm newbie programmer with little experience, so please help me if u can.
    I have found an example on how to create java classes from WSDL under maven:
    (...)<taskdef classname="org.codehaus.xfire.gen.WsGenTask" name="wsgen">(...)
    I've created the below java class and I create new object of this class: UploadChunk up = new UploadChunk()
    and up.setSomething(123) etc....
    I have some service for which I have to prepare soap request manually - suitable for my service requests.
    I'm doing it using dom4j to create xml documents and i rewrite values to it from my variable up.
    I wonder if it is possible to do it automatically - I have UploadChunk object and I want do use xFire library somehow to produce ready or almost ready soap request. I want to do it in my code, no some ant or maven task.
    So I propably need a couple line of code, when I have:
    up.setSomething(123);
    //////CONVERTION - CAN U TELL ME HOW TO DO THAT PLEASE? I haven't found the way :( it seems I need your help.
    //////Document result =....
    callService(result,namespace,qname);
    import javax.xml.bind.annotation.XmlAccessType;
    import javax.xml.bind.annotation.XmlAccessorType;
    import javax.xml.bind.annotation.XmlElement;
    import javax.xml.bind.annotation.XmlType;
    * <p>Java class for UploadChunk complex type.
    * <p>The following schema fragment specifies the expected content contained within this class.
    * <pre>
    * <complexType name="UploadChunk">
    *   <complexContent>
    *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    *       <sequence>
    *         <element name="SessionID" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
    *         <element name="InputFileName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
    *         <element name="Buffer" type="{http://www.w3.org/2001/XMLSchema}base64Binary" minOccurs="0"/>
    *         <element name="Offset" type="{http://www.w3.org/2001/XMLSchema}long"/>
    *         <element name="BytesRead" type="{http://www.w3.org/2001/XMLSchema}int"/>
    *       </sequence>
    *     </restriction>
    *   </complexContent>
    * </complexType>
    * </pre>
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "UploadChunk", propOrder = {
        "sessionID",
        "inputFileName",
        "buffer",
        "offset",
        "bytesRead"
    public class UploadChunk {
        @XmlElement(name = "SessionID")
        protected String sessionID;
        @XmlElement(name = "InputFileName")
        protected String inputFileName;
        @XmlElement(name = "Buffer")
        protected byte[] buffer;
        @XmlElement(name = "Offset")
        protected long offset;
        @XmlElement(name = "BytesRead")
        protected int bytesRead;
         * Gets the value of the sessionID property.
         * @return
         *     possible object is
         *     {@link String }
        public String getSessionID() {
            return sessionID;
         * Sets the value of the sessionID property.
         * @param value
         *     allowed object is
         *     {@link String }
        public void setSessionID(String value) {
            this.sessionID = value;
         * Gets the value of the inputFileName property.
         * @return
         *     possible object is
         *     {@link String }
        public String getInputFileName() {
            return inputFileName;
         * Sets the value of the inputFileName property.
         * @param value
         *     allowed object is
         *     {@link String }
        public void setInputFileName(String value) {
            this.inputFileName = value;
         * Gets the value of the buffer property.
         * @return
         *     possible object is
         *     byte[]
        public byte[] getBuffer() {
            return buffer;
         * Sets the value of the buffer property.
         * @param value
         *     allowed object is
         *     byte[]
        public void setBuffer(byte[] value) {
            this.buffer = ((byte[]) value);
         * Gets the value of the offset property.
        public long getOffset() {
            return offset;
         * Sets the value of the offset property.
        public void setOffset(long value) {
            this.offset = value;
         * Gets the value of the bytesRead property.
        public int getBytesRead() {
            return bytesRead;
         * Sets the value of the bytesRead property.
        public void setBytesRead(int value) {
            this.bytesRead = value;
    }

    Hi,
    Can u Please post the WSDL..here. I remember long back i resolved this kind of issue...when i was getting "*parameters is already defined in - - -*" while using ClientGen.
    Once i will get the WSDL may be i can recall it...
    If u have any problem in Posting the WSDL..in Forums .. then let me know I will send my E-Mail Address...
    As far as i remember ..it usually happens when we Run ClientGen task of WLS81 ON the WebService/WSDL generated by WebLogic 9.x or Above. Please let me know if this is the Case with you as well... . I remember there is a Patch for it...for WLS8 ClientGen task...I dont remember the Patch Number Exactly.
    Just For testing:
    Just Use WLS9.x ClientGen task On the Same WSDL
    <taskdef name="clientgen" classname="weblogic.wsee.tools.anttasks.ClientGenTask" />
    I am sure you will not see this issue... because the issue is there only with WLS8 Clientgen...
    Thanks
    Jay SenSharma
    http://jaysensharma.wordpress.com (WebLogic Wonders Are Here)
    Edited by: Jay SenSharma on Jan 8, 2010 4:32 PM
    Edited by: Jay SenSharma on Jan 8, 2010 4:34 PM

  • IMPDP to import  JAVA CLASS  and JAVA SOURCE from .DMP file

    hi,
    I have a schema X, In that schema some of the *"JAVA CLASS" and "JAVA SOURCE"* objects are missing ..
    The procedures ,functions..etc objects were updated at X schema..
    I have 1 dmp file of Y schema , containing the missing "JAVA CLASS" and "JAVA SOURCE" s.. Can I import the the same to the schema X using IMPDP
    i tried using INCLUDE clause but it is not working
    eg:
    impdp john1/john1@me11g22 directory=datadump dumpfile=DEVF2WAR.DMP remap_schema=devf2war:john INCLUDE="JAVA CLASS","JAVA CLASS"but error..
    ORA-39001: invalid argument value
    ORA-39041: Filter  "INCLUDE" either identifies all object types or no object types.regards,
    jp

    Hello,
    You should type JAVA_CLASS and JAVA_SOURCE (use underscore instead of space).
    impdp john1/john1@me11g22 directory=datadump dumpfile=DEVF2WAR.DMP remap_schema=devf2war:john INCLUDE="JAVA_CLASS","JAVA_CLASS"Best Regards,
    Gokhan Atil
    If this question is answered, please mark appropriate posts as correct/helpful and the thread as closed. Thanks

  • Using java class and variables declared in java file in jsp

    hi everyone
    i m trying to seperate business logic form web layer. i don't know i am doing in a right way or not.
    i wanted to access my own java class and its variables in jsp.
    for this i created java file like this
    package ris;
    import java.sql.*;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    public class  NewClass{
        public static void main(String args[]){
            Connection con = null;
            ResultSet rs=null;
            Statement smt=null;
            try{
                Class.forName("com.mysql.jdbc.Driver").newInstance();
                con=DriverManager.getConnection("jdbc:mysql:///net","root", "anthony111");
                smt=con.createStatement();
               rs= smt.executeQuery("SELECT * FROM emp");
               while(rs.next()){
                String  str = rs.getString("Name");
                }catch( Exception e){
                    String msg="Exception:"+e.getMessage();
                }finally {
          try {
            if(con != null)
              con.close();
          } catch(SQLException e) {}
    }next i created a jsp where i want to access String str defined in java class above.
    <%--
        Document   : fisrt
        Created on : Jul 25, 2009, 3:00:38 PM
        Author     : REiSHI
    --%>
    <%@page import="ris.NewClass"%>
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
            <h1><%=str%></h1>
        </body>
    </html>I wanted to print the name field extracted from database by ResultSet.
    but it gives error cannot find symbol str.
    please help me to find right way to do this.
    i am using netbeans ide.

    Very bad approach
    1) Think if your table contains more than one NAMEs then you will get only the last one with your code.
    2) Your String is declared as local variable in the method.
    3) You have not created any object of NewClass nor called the method in JSP page. Then who will call the method to run sql?
    4) Your NewClass contains main method which will not work in web application, it's not standalone desktop application so remove main.
    Better create an ArrayList and then call the method of NewClass and then store the data into ArrayList and return the ArrayList.
    It should look like
    {code:java}
    package ris;
    import java.sql.*;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    public class  NewClass{
        public static ArrayList getNames(){
            Connection con = null;
            ResultSet rs=null;
            Statement smt=null;
            ArrayList nameList = new ArrayList();
            try{
                Class.forName("com.mysql.jdbc.Driver").newInstance();
                con=DriverManager.getConnection("jdbc:mysql:///net","root", "anthony111");
                smt=con.createStatement();
               rs= smt.executeQuery("SELECT * FROM emp");
               while(rs.next()){
                nameList.add(rs.getString("Name"));
               return nameList;
                }catch( Exception e){
                    String msg="Exception:"+e.getMessage();
                   </code><code class="jive-code jive-java"><font>return nameList;</code><code class="jive-code jive-java">
                }finally {
          try {
            if(con != null)
              con.close();
          } catch(SQLException e) {}
          </code><code>return nameList;</code>
    <code class="jive-code jive-java">    }

  • WEB SERVICE FROM JAVA CLASS

    Hi,
    I'm new to BPEL and I've a problem: i need to create a WEBSERVICE from Java class.
    This Java class contain functions to call other functions in other packages.
    These last function contain sql query: it's an java "interface" application between BPEL and an EXTERNAL Oracle database 10g.
    I want to create one WEB SERVICE from this application and i followed the steps (right click, menù, create j2ee webservice, etc) i obtain error:
    VALIDATION FAILED --- Files at the following URLs cannot be modified:
    File:/C:/OraBPELPM1/integration/jdev/jdev/mywork/RichiesteWebService/ARRICH/app/src/controller/MyWebService1.webservice
    File:/C:/OraBPELPM1/integration/jdev/jdev/mywork/RichiesteWebService/ARRICH/app/src/controller/IMyWebService.wsdl
    File:/C:/OraBPELPM1/integration/jdev/jdev/mywork/RichiesteWebService/ARRICH/app/src/controller/MyWebService1.dd
    Show the java class "interface":
    package controller;
    import java.util.*;
    import java.sql.*;
    import domain.*;
    import dao.*;
    import utility.*;
    public class Request_Incoming_Controller {
    public Request_Incoming_Controller() {}
    /* Update StatoTurismo */
    public static String aggiornaStTurismo(int numIncoming, String tur) {
    GregorianCalendar dp = FormatoData.dataDaDate1("00/00/0000");
    Request_Incoming ric = new Request_Incoming(numIncoming,"","",dp,dp,"","","",0,"",tur,"");
    // try {
    if(ric.aggiornaTurismo()<0)return "NO";
    return "OK";
    // } catch (SQLException ex) {
    // System.err.println("Eccezione durante l'aggiornamento "
    // + ex.getMessage()); }
    /* Update StatoCassa */
    public static String aggiornaStCassa(int numIncoming,String cash) {
    GregorianCalendar dp = FormatoData.dataDaDate1("00/00/0000");
    Request_Incoming ric = new Request_Incoming(numIncoming,"","",dp,dp,"","","",0,"","",cash);
    // try {
    if(ric.aggiornaCassa()<0) return "NO";
    return "OK";
    // } catch (SQLException ex) {
    // System.err.println("Eccezione durante l'aggiornamento "
    // + ex.getMessage()); }
    /* Lettura del NumIncoming assegnato dal sistema dopo il caricamento della
    * richiesta in base alla matricola del Dipendente
    public static int caricaNumDaDip(String dipendente){
    Request_Incoming ric = new Request_Incoming(0,dipendente);
    // try {
    ric.trovaNumIncoming();
    return ric.getNumIncoming();
    // } catch (SQLException ex) {
    // System.err.println("Eccezione durante l'aggiornamento "
    // + ex.getMessage()); }
    Can Anyone help?
    Is urgently.........thanks
    Daniele

    You should try to post it there:
    http://forums.oracle.com/forums/forum.jspa?forumID=97
    But if I look at the error, it looks like some files are Read-Only. Maybe you should check if they are or if you have the appropriate rights on the folder.
    Good luck

Maybe you are looking for

  • Works right if closed and re-opened.

    What can I do to get iCal window to display after start-up? Works correctly if closed and re-opened.

  • Sync gmail sent items

    Hi, i recently setup Gmail IMAP on my IPAD2, like Google said in it's docs, and noticed that I have 2 folders of "Sent Items" on my Ipad2 Mail app and both are empty, both return empty searches when i try to search in them, and both say: Updated : 11

  • Change Data Capture (CDC) now capturing default values

    Hi, I am using SQL Server 2012 and to me a part of data captured by CDC is not making sense. I have a table called 'Schema.Table1', and I enabled CDC on it by running 'sys.sp_cdc_enable_table'. I see that a table called 'cdc.Schema_Table1_CT' got cre

  • How do i complexly remove previous cs6 trial download files/software in order to download a more

    how do i completely remove previous cs6 trial downloads from the computer where we have multiple users downloading adobe trials periodically?

  • Failed to initialize my custom LoginModule

    Hello, I just developped a loginmodule. I also tried with several examples I found on the forum (thanks for this help). When I start Tomcat Th constructor of the LoginModule is successfull but Tomcat stops before the call of the initialize method. I