How to return ResultSet from one function to another?

Hi friends,
Greetings.
How do we pass the query Results from one function to another function?
Actually i have a database in the server and i am the client.
Client sends the id to the server as an argument. From HTML file this goes to the JSP file(which i am using as a link between HTML and EJB) and then this goes to the RemoteInterface and then to the Bean itself. The functions are written in the bean. Bean connects to the database using jdbc:odbc driver and then a query is written and executed as follows:
In the Stateless Session Bean, there is one function with the following query.
public ResultSet check(String id)
//other code
ResultSet rs = Statement.("select * from table1 where id=123");
if(!rs.next)
// print no such id exists. other ids are
rs=Statement.("select * from table1");
return rs;
I have written it approximately only because the problem is not with the query :(
Now, in rs there's a resultset. Now how do i display it in a tabular format in HTML? This should obviously be done using JSP. How can we do it?
In JSP file if i write
ResultSet rs1=Remote.check(12);
i get NullPointerException
Thank you in anticipation to your reply!
Regards

Crossposted over all places:
[http://forums.sun.com/thread.jspa?threadID=5336533]
[http://forums.sun.com/thread.jspa?threadID=5336534]
[http://forums.sun.com/thread.jspa?threadID=5336532]
[http://forums.sun.com/thread.jspa?threadID=5336519]
[http://forums.sun.com/thread.jspa?threadID=5336510]
Stop crossposting. It's very rude.

Similar Messages

  • Passing ResultSet from one function to another

    Hi friends,
    Greetings.
    I am a beginner in Java.
    I am doing an exercise using jdbc:odbc driver where i have to query the database in one function and pass the ResultSet to another function.
    Let function1 be
    ResultSet select(String sel) // sel is the id of what is to be selected { Resultset rs= //coding return rs; }
    Let function2 be
    function2 { String id="abc"; ResultSet rs1=select(id); //code to print rs1 }
    Is my code correct? i get a NullPointerException always.
    Please help
    Regards.

    rampalli_aravind wrote:
    Thanks a ton for the reply!
    Well,
    how do i pass the query Results?
    Actually i have a database in the server and i am the client.
    Client sends the id to the server. Server processes. finds the id and returns the name and other details using SQL statement:
    select * from table1 where id="abc";Server should return these details back to the client.
    IF no such id exists then server should send the client the following result:
    //print that the given id does not exist and these are the ids and names in table1
    select * from table1;How can i do it using jdbc odbc driver?
    Thank you in anticipation to your reply!
    Regardssee my reply to your other post.
    write a server side component that opens the connection to the database, loads the ResultSet into a data structure, closes the ResultSet, and returns the data structure to the client.
    the client should not be dealing directly with the database.
    %

  • How to pass values from one function to another

    Hi,
    I am a middle school teacher and a newbie in Flash Actionscript. I am trying to create a countdown timer for use in my class during tests. The start and pause functions work as required, but not the pause button. When I click on the pause button, the timer is reset to 0:00:00. Please help. Here is the code I had written so far:
    var Subject1timeLeftHr;
    var Subject1timeLeftMin;
    var Subject1timeLeftSec;
    Subject1start_btn._visible = true;
    Subject1pause_btn._visible = false;
    Subject1rotor_mc.gotoAndStop(1);
    Subject1rotor_mc._visible = false;
    Subject1durationHr_txt.text = "0";
    Subject1durationMin_txt.text = "00";
    Subject1durationSec_txt.text = "00";
    Selection.setFocus(Subject1durationHr_txt);
    function SubjectdurationHr(SubjectxdurationHr_txt, SubjectxdurationMin_txt)
    if (SubjectxdurationHr_txt.length == 1)
    Selection.setFocus(SubjectxdurationMin_txt);
    function SubjectdurationMin(SubjectxdurationMin_txt, SubjectxdurationSec_txt)
    if (SubjectxdurationMin_txt.length == 2)
    Selection.setFocus(SubjectxdurationSec_txt);
    function SubjectdurationSec(SubjectxdurationSec_txt, SubjectxdurationHr_txt)
    if (SubjectxdurationSec_txt.length == 2)
    Selection.setFocus(SubjectxdurationHr_txt);
    Subject1durationHr_txt.onChanged = function()
    SubjectdurationHr(Subject1durationHr_txt,Subject1durationMin_txt);
    Subject1durationMin_txt.onChanged = function()
    SubjectdurationMin(Subject1durationMin_txt,Subject1durationSec_txt);
    Subject1durationSec_txt.onChanged = function()
    SubjectdurationSec(Subject1durationSec_txt,Subject1durationHr_txt);
    function startcountdown(SubjectxdurationLeft, SubjectxdurationHr, SubjectxdurationHr_txt, SubjectxdurationMin, SubjectxdurationMin_txt, SubjectxdurationSec, SubjectxdurationSec_txt, Subjectxduration, SubjectxstartTime, SubjectxendTime, Subjectxtimer_mc, Subjectxpause_btn, Subjectxstart_btn, Subjectxrotor_mc, SubjectxtimeLeft, SubjectxtimeLeftHr, SubjectxtimeLeftMin, SubjectxtimeLeftSec, SubjectxtimeLeftHr_txt, SubjectxtimeLeftMin_txt, SubjectxtimeLeftSec_txt)
    delete SubjectxdurationLeft;
    delete SubjectxdurationHr;
    delete SubjectxdurationMin;
    delete SubjectxdurationSec;
    delete Subjectxduration;
    delete SubjectxdurationHr_txt.text;
    delete SubjectxdurationMin_txt.text;
    delete SubjectxdurationSec_txt.text;
    SubjectxstartTime = getTimer();
    Subjectxtimer_mc.onEnterFrame = function()
    if (SubjectxdurationHr_txt.text == Nan || SubjectxdurationMin_txt.text == Nan || SubjectxdurationSec_txt.text == Nan)
    else
    SubjectxdurationHr = 60 * 60 * 1000 * Number(SubjectxdurationHr_txt.text);
    SubjectxdurationMin = 60 * 1000 * Number(SubjectxdurationMin_txt.text);
    SubjectxdurationSec = 1000 * Number(SubjectxdurationSec_txt.text);
    Subjectxduration = SubjectxdurationHr + SubjectxdurationMin + SubjectxdurationSec;
    SubjectxendTime = SubjectxstartTime + Subjectxduration;
    SubjectxdurationLeft = SubjectxendTime - getTimer();
    if (SubjectxdurationLeft > 0)
    SubjectxdurationHr_txt._visible = false;
    SubjectxdurationMin_txt._visible = false;
    SubjectxdurationSec_txt._visible = false;
    Subjectxpause_btn._visible = true;
    Subjectxstart_btn._visible = false;
    Subjectxrotor_mc._visible = true;
    Subjectxrotor_mc.play();
    SubjectxtimeLeft = SubjectxdurationLeft / (1000 * 60 * 60);
    SubjectxtimeLeftHr = Math.floor(SubjectxtimeLeft);
    SubjectxtimeLeftMin = Math.floor((SubjectxtimeLeft - SubjectxtimeLeftHr) * 60);
    SubjectxtimeLeftSec = Math.floor(((SubjectxtimeLeft - SubjectxtimeLeftHr) * 60 - SubjectxtimeLeftMin) * 60);
    SubjectxtimeLeftHr_txt.text = String(SubjectxtimeLeftHr);
    if (SubjectxtimeLeftHr_txt.length < 1)
    SubjectxtimeLeftHr_txt.text = "0" + SubjectxtimeLeftHr_txt.text;
    SubjectxtimeLeftMin_txt.text = String(SubjectxtimeLeftMin);
    if (SubjectxtimeLeftMin_txt.length < 2)
    SubjectxtimeLeftMin_txt.text = "0" + SubjectxtimeLeftMin_txt.text;
    SubjectxtimeLeftSec_txt.text = String(SubjectxtimeLeftSec);
    if (SubjectxtimeLeftSec_txt.length < 2)
    SubjectxtimeLeftSec_txt.text = "0" + SubjectxtimeLeftSec_txt.text;
    else
    delete Subjectxtimer_mc.onEnterFrame;
    SubjectxtimeLeftHr_txt.text = "";
    SubjectxtimeLeftMin_txt.text = "";
    SubjectxtimeLeftSec_txt.text = "";
    SubjectxdurationHr_txt._visible = true;
    SubjectxdurationMin_txt._visible = true;
    SubjectxdurationSec_txt._visible = true;
    Subjectxrotor_mc.gotoAndStop(1);
    Subjectxrotor_mc._visible = false;
    SubjectxdurationHr_txt.text = "0";
    SubjectxdurationMin_txt.text = "00";
    SubjectxdurationSec_txt.text = "00";
    Subjectxpause_btn._visible = false;
    Subjectxstart_btn._visible = true;
    Selection.setFocus(SubjectxdurationHr_txt);
    function pausecountdown(SubjectxdurationHr_txt, SubjectxtimeLeftHr, SubjectxdurationMin_txt, SubjectxtimeLeftMin, SubjectxdurationSec_txt, SubjectxtimeLeftSec, Subjectxstart_btn, Subjectxpause_btn, Subjectxrotor_mc)
    delete Subjectxtimer_mc.onEnterFrame;
    SubjectxdurationHr_txt.text = String(SubjectxtimeLeftHr);
    SubjectxdurationMin_txt.text = String(SubjectxtimeLeftMin);
    SubjectxdurationSec_txt.text = String(SubjectxtimeLeftSec);
    Subjectxstart_btn._visible = true;
    Subjectxpause_btn._visible = false;
    Subjectxrotor_mc.stop();
    Subject1pause_btn.onRelease = function()
    pausecountdown(Subject1durationHr_txt,Subject1timeLeftHr,Subject1durationMin_txt,Subject1t imeLeftMin,Subject1durationSec_txt,Subject1timeLeftSec,Subject1start_btn,Subject1pause_btn ,Subject1rotor_mc);
    Subject1start_btn.onRelease = function()
    startcountdown(Subject1durationLeft,Subject1durationHr,Subject1durationHr_txt,Subject1dura tionMin,Subject1durationMin_txt,Subject1durationSec,Subject1durationSec_txt,Subject1durati on,Subject1startTime,Subject1endTime,Subject1timer_mc,Subject1pause_btn,Subject1start_btn, Subject1rotor_mc,Subject1timeLeft,Subject1timeLeftHr,Subject1timeLeftMin,Subject1timeLeftS ec,Subject1timeLeftHr_txt,Subject1timeLeftMin_txt,Subject1timeLeftSec_txt);
    Subject1cancel_btn.onRelease = function()
    Subject1timeLeftHr_txt.text = "";
    Subject1timeLeftMin_txt.text = "";
    Subject1timeLeftSec_txt.text = "";
    Subject1durationHr_txt._visible = true;
    Subject1durationMin_txt._visible = true;
    Subject1durationSec_txt._visible = true;
    Subject1durationHr_txt.text = "0";
    Subject1durationMin_txt.text = "00";
    Subject1durationSec_txt.text = "00";
    Subject1timeLeftHr_txt._visible = true;
    Subject1timeLeftMin_txt._visible = true;
    Subject1timeLeftSec_txt._visible = true;
    Subject1pause_btn._visible = false;
    Subject1start_btn._visible = true;
    Subject1rotor_mc._visible = false;
    Subject1rotor_mc.gotoAndStop(1);
    delete Subject1timer_mc.onEnterFrame;
    delete Subject1durationLeft;
    delete Subject1duration;
    delete Subject1durationHr_txt.text;
    delete Subject1durationMin_txt.text;
    delete Subject1durationSec_txt.text;

    I think you need to spend some time reducing your code to practical levels.  You seem to be passing everything in the book to every function and I would guess that probably none of it is necessary.  If you declared those variables at the beginning, then you don't need to pass them into any function because they are gobally available to any of the code/functions that follows them.  Similarly, if you have textfields on the stage, you do not need to pass those into any functions for the same reason.
    I see you making overuse of "delete" (and possibly errant use as well).  Probably the only thing you might want/need to use is...
    delete Subjectxtimer_mc.onEnterFrame;
    Which stops the enterframe activity from firing off, which I will guess is being used to update the textfields that indicate the time.
    And that conditional that uses == Nan isn't likely to do anything except wonder what an Nan is.  Textfields hold strings, which are quoted.  SO unless you have a variable named Nan somewhere that has a String value assigned to it, that conditional won't be doing anything for you.  You probably won't need it at all if you get this working properly.

  • Passing arguments scope from one function to another

    Is it possible to pass the arguments structure from one
    function to another when it contains unnamed arguments? It doesn't
    throw an error but the values and indexes in the arguments scope
    get messed up. To see what I mean, compare the two cfdumps below.
    CODE
    <cfset myComponent = createObject("component",
    "MyComponent").init() />
    <cfset myComponent.get("TypeName", "KeyA", "ValueA",
    "KeyB", "ValueB") />
    <cfcomponent>
    <cffunction name="get" output="true">
    <cfargument name="type" type="string" required="yes"
    />
    <b>get() arguments</b><br />
    <cfdump var="#arguments#" />
    <cfset create(argumentCollection=arguments) />
    </cffunction>
    <cffunction name="create" output="true">
    <cfargument name="type" type="string" required="yes"
    />
    <b>create() arguments</b><br />
    <cfdump var="#arguments#" />
    </cffunction>
    </cfcomponent>
    CFDUMP OUTPUT
    get() arguments
    struct
    2 KeyA
    3 ValueA
    4 KeyB
    5 ValueB
    TYPE TypeName
    create() arguments
    struct
    2 [undefined struct element]
    3 TypeName
    4 KeyB
    5 ValueA
    TYPE TypeName

    rampalli_aravind wrote:
    Thanks a ton for the reply!
    Well,
    how do i pass the query Results?
    Actually i have a database in the server and i am the client.
    Client sends the id to the server. Server processes. finds the id and returns the name and other details using SQL statement:
    select * from table1 where id="abc";Server should return these details back to the client.
    IF no such id exists then server should send the client the following result:
    //print that the given id does not exist and these are the ids and names in table1
    select * from table1;How can i do it using jdbc odbc driver?
    Thank you in anticipation to your reply!
    Regardssee my reply to your other post.
    write a server side component that opens the connection to the database, loads the ResultSet into a data structure, closes the ResultSet, and returns the data structure to the client.
    the client should not be dealing directly with the database.
    %

  • How to transfer pictures from one itunes to another?

    I have most of my iPod stuff on my laptop, but my pictures are on my mac. I just got a new iPod, and I did what I normally do to get my pictures onto it- go into itunes, go into my pictures, and apply it. This time, however, not all of the pictures got transferred. I think it would be easier to have all my pictures on my laptop, but I do not know how to transfer them from one computer to another. How can I do this?

    If they are synced photos just copy the folders with the photos to the new computer. Synced photos are not associated with iTunes or the iTunes library.

  • How to transfer Signatures from one Mac to another

    In Mail, if I go to Preferences > Signatures, I see in the left column *All Signatures*, and signatures for various accounts.
    How would I transfer the signatures in *All Signatures* from one Mac to another?
    The names of files in the folder ~/Library/Mail/Signatures are all cryptic.
    Moreover, since each signature is tied to a certain account, I don't think that I can just copy these files into the Signature folder of the 2nd Mac.

    Simply moving these cryptic files did not work, in the sense that these signatures did not show up in the right-most column of the Signatures pane.
    I made sure that I did not move the SignaturesByAccount.plist file in the ~/Library/Mail/Signatures folder.
    So, would someone please share with me how to transfer signatures from one Mac to another, with both running Mail?

  • How to transfer photos from one rhyme to another?

    how to transfer photos from one rhyme to another?

    Can you connect the phone to the computer as a disk drive using the usb cable supplied with the phone? Copy the files from the first phone. Disconnect it properly. Connect the second phone in the same manner. This time copy the files from the computer to the phone in the same place where you found them on the other phone.

  • How  to transfer data from one system to another by datamart please give de

    how  to transfer data from one system to another by datamart please give details

    Hi Deba,
    Find the below SAP help doc which may help u...
    http://help.sap.com/saphelp_nw70/helpdata/en/12/43074208ae2a38e10000000a1550b0/frameset.htm
    Also find the below threads...
    Loading data from one cube to another cube.
    data copy from infocube to infocube in two different BW systems
    Delta when loading from ODS to ODS
    reg datamart
    Data mart flag
    Regards,
    KK.

  • How to transfer bookmarks from one computer to another?

    how to transfer bookmarks from one computer to another?

    Export your bookmarks (file menu in Safari, from the Show All Bookmarks option in Firefox) and save to your HD. Copy the saved .html file to the other Mac over the network, or by copying the file to a USB stick and copying to the other Mac, or emailing them to the other Mac. On the other Mac import the Bookmarks file into your browser of choice,

  • How to transfer photos from one make to another

    How to transfer photos from one mac to another wirelessly

    I can give you a few ways to so:
    First (and my favorite way) is the one said above.  First, on the computer with the photos on it, you have to do is turn on file sharing (go to system preferences, sharing, file sharing) and have both computers on the same network.  Second, have the computers you want the photos on, and launch finder.  On the sidebar, there should be a "sharing" category, and below it should be the computer with the photos on it.  Click on it, and you will be prompted for the computer username and password.  It will then show all of the files on your computer.  Then, just find the files, copy them (command-C) and paste them to where you want them! (If this confuses you, I can upload a video step-by-step on how to do this).
    My second way is to use air drop. To start, Both computers must be on the same network.  Then, on the computer with the photos on it select all of the photos you want to send to the other computer (you can select many photos by holding the command key and clicking on photos), right-click (control-click) on the selected photos, find the button share, and click air drop.  On the computer you want the photos on, go to air drop on the side bar.  You should see the name of the computer on the radar-looking screen.  Click your computer.  The photos should begin to download to the downloads folder. (This feature is only compatible with certain computers)

  • How to transfer photos from one computer to another

    How to transfer photos from one computer to another fast from iMac to MacBook both on lion
    help. Tried airdrop to slow

    Hi roseabe
    Please give us more details. What kind of computer (model, speed) are you trying to transfer from and to?
    Besides, you don't hold down cmd/apple+"T" on the target computer - just the "T" key.
    Matt

  • How to transfer songs from one iPad to another iPad using iTunes?

    How to transfer songs from one iPad to another iPad using iTunes?

    You can't without a third party app. If you didn't purchase the Music with your Apple ID or if the music was imported from CD's on your friends iTunes library, syncing will not work ....nor will transferring purchases.
    Look at this app .... TouchCopy
    http://www.wideanglesoftware.com/touchcopy/index.php

  • How do I move from one website to another using Safari, while still allowing Pandora to provide music in the background? It seems that when ever I open a new URL, I lose Pandora.

    How do I move from one website to another using Safari, while still allowing Pandora to provide music in the background? It seems that when ever I open a new URL, I lose Pandora.

    Try running Pandora in its own tab and leaving that tab open (Safari 7.1.5, OS 10.9.5).  I don't have Pandora to try this, but it works for me otherwise.
    Good luck
    srb

  • OBIEE 11g How to pass variable from one prompt to another prompt in dashboard page.

      How to pass variable from one prompt to another prompt in dashboard page.
    I have two prompt in dashboard page as below.
    Reporttype
    prompt: values(Accounting, Operational) Note: values stored as
    presentation variable and they are not coming from table.
    Date prompt values (Account_date, Operation_date)
    Note:values are coming from dim_date table.  
    Now the task is When user select First
    Prompt value  “Accounting” Then in the
    second prompt should display only Accounting_dates , if user select “operational”
    and it should display only operation_dates in second prompt.
    In order to solve this issue I made the
    first prompt “Reporttype” values(Accounting, Operational) as presentation
    values (custom specific values) and default presentation value is accounting.
    In second prompt Date are coming from
    dim_date table and I selected Sql results as shown below.
    SELECT case when '@{Reporttype}'='Accounting'
    then "Dates (Receipts)"."Acct Year"
    else "Dates (Receipts)"."Ops
    Year"  End  FROM "Receipts"
    Issue: Presentation variable value is not
    changing in sql when user select “operation” and second prompt always shows
    acct year in second prompt.
    For testing pupose I kept this presentation
    variable in text object of dashboard and values are changing there, but not in
    second prompt sql.
    Please suggest the solution.

    You will want to use the MoveClipLoader class (using its loadClip() and addListener() methods) rather than loadMovie so that you can wait for the file to load before you try to access anything in it.  You can create an empty movieclip to load the swf into, and in that way the loaded file can be targeted using the empty movieclip instance name.

  • How to include iview from one page to another using FPM

    Dear experts
    using ECC6 NetWeaver 7
    I have followed this WIKI guide step by step.
    How to include iview from one page to another using FPM?
    https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=118423928
    On step 4 I couldnu2019t create an Iview based on view u201Cpersonal datau201D u2013 it was not possible.
    The view wasnu2019t there (in comprehend to the  WIKI)
    What could be the reason?
    I have full authorization on the portal.
    Thank in advance for your help.

    Please check this.
    Re: Organizational History iView
    /thread/370447 [original link is broken]
    Regards,
    Sandip

Maybe you are looking for

  • Lost my photos from iPhoto after upgrading 10.5.8 to Snow Leopard and then to Yosemite.

    I just bought Snow Leopard to upgrade my iMac from 2009. It was running OS 10.5.8. I ran all the updates for 10.6.8 before I went ahead and download Yosemite. My iPhotos won't open, I downloaded the "iPhoto upgrader" from the apple website and it did

  • Formula problems

    Hello, I've a problem with a formula in CR XI which I can't solve. I hope that some here can help me. The problem is: Sum({@formule}) The warning is: Cannot summarize this field. How can I solve this?

  • Database Links and Character Sets

    Can I link a ARABIC Character set database to an English Character one using database links. The Application running on the Arabic database needs to read and write into the English one using a database link.

  • FICA Document Approval - CA_DOC, Workflow 21000088

    Hi All, I am using the standard Workflow 21000088 for FICA document approval for Posting using the Business Object CA_DOC. I had maintained Event 5500 as well as Rule for Agent assignment using Rule - 21000056. Now whenever any posting happens, An ap

  • Infopackage:Determine the variables for periodic data loading

    Hi, we have an infopackage for full update and we have set in "Data selection" tab as selection , an OLAP variable. If I do the load using the  OLAP variable selection, 12 last months , I need to delete data can be duplicated. But for example, If I d