Result set --- can you reference in two locations (jsp and doVIew())

I need help figuring out what I am doing wrong.
In my doView() function I am saving a result set
  NamingEnumeration person = details.executeDetails(fullname);I need to reference this result set from my doView method and inside my jsp page, this is why I have stored this inside a session variable.
//doView() method
NamingEnumeration person = details.executeDetails(fullname);
if(person != null){                           
  while(person.hasMore()){
   SearchResult sr = (SearchResult)person.next();
   Attributes attributes = sr.getAttributes();
   Attribute attr = attributes.get("x500UniqueIdentifier");
   if (attr != null) {
    Object val = attr.get();
    byte[] buf = (byte[])val;
    String number = new String(buf);
    person_number = removeLeadingZeros(number);
person.close();
session.setAttribute("person", person, PortletSession.PORTLET_SCOPE);     
//jsp page
NamingEnumeration results = (NamingEnumeration)renderRequest.getPortletSession().getAttribute("person");
<% if(results != null){
      while(results.hasMore()){
        SearchResult sr = (SearchResult)results.next();
        Attributes attributes = sr.getAttributes();
        String fullName = attributes.get("fullName").toString();
        String description = attributes.get("description").toString();
        String title = attributes.get("title").toString();
        String mail = attributes.get("mail").toString();
        String eduPersonPrimaryAffiliation = attributes.get("eduPersonPrimaryAffiliation").toString();
        String telephoneNumber = attributes.get("telephoneNumber").toString();
        String postOfficeBox = attributes.get("postOfficeBox").toString();
        String[] Name = fullName.split(":");
        String[] Desc = description.split(":");
        String[] JobTitle = title.split(":");
        String[] Email = mail.split(":");
        String[] Class = eduPersonPrimaryAffiliation.split(":");
        String[] Phone = telephoneNumber.split(":");
        String[] BoxNo = postOfficeBox.split(":");
        %>
            //....................... Bunch of printing information here        
           }//end while
     }//end if
     else{%>
          <div>No results found.</div>
     <%}
      results.close();
Can you not reference a result set from both of these locations?
Thanks.

Hi Gravy Train,
I'm curious about why you are using 2 loops.   You mentioned one is for monitoring and one is for DAQ....what do you mean by that?   What is the overall goal of this piece of code.   Also, I noticed that you are not closing the task.   Since this is just a subset, I realize you could be closing it in your actual code, but just in case you're not.....it is very important that you close all tasks when you are down acquiring data.
Best Regards,
Starla T  

Similar Messages

  • Can you text between two iPod touch iPods and is it free?

    Can you text between two iPod touches and is it free?  Is it free to text from Canada to US?

    Yes and yes. Both iPodsneed to have iOS 5 installed.

  • SCROLL_SENSITIVE result set can't see the data inserted.

    hi all ,
    I am trying to display all the latest data available in the table through SCROLL_SENSITIVE and UPDATABLE result set after inserting a new record in the table.
    But the result set obtained after executing the query initially is not able to see the newly inserted record in the table and hence same result is getting printed out in both the cases.
    Can u explain me what's happening in this case ?? And how can i get the updated record also without executing the statement query twice to get the latest result set.
    My full code is given below.
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    public class Misc3 {
    public static void main(String[] args) {
    Connection con = null;
    Statement stmt = null;
    ResultSet rs = null;
    try {
    int empid;
    String lname;
    String fname;
    int deptno;
    int mngrid;
    con = JDBCUtil.getOracleConnection();
    stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
    String query = "select employee_id , last_name , first_name , department_number , manager_id from employees ";
    rs = stmt.executeQuery(query);
    System.out.println("Before inserting the new record.....");
    while (rs.next()) {
    empid = rs.getInt(1);
    lname = rs.getString(2);
    fname = rs.getString(3);
    deptno = rs.getInt(4);
    mngrid = rs.getInt(5);
    System.out.println(empid + "\t" + lname + "\t" + fname + "\t" + deptno + "\t" + mngrid);
    System.out.println("Going to insert the new record.....");
    rs.moveToInsertRow();
    rs.updateInt(1, 10);
    rs.updateString(2, "Clark");
    rs.updateString(3, "John");
    rs.updateInt(4, 2);
    rs.updateInt(5, 2);
    rs.insertRow();
    System.out.println("New record inserted successfully.....");
    System.out.println("After inserting the new record.....");
    rs.beforeFirst();
    while (rs.next()) {
    empid = rs.getInt(1);
    lname = rs.getString(2);
    fname = rs.getString(3);
    deptno = rs.getInt(4);
    mngrid = rs.getInt(5);
    System.out.println(empid + "\t" + lname + "\t" + fname + "\t" + deptno + "\t" + mngrid);
    } catch (SQLException ex) {
    System.out.println("error code : " + ex.getErrorCode());
    System.out.println("error message : " + ex.getMessage());
    } finally {
    JDBCUtil.cleanUp(con, stmt);
    *** JDBCUtil Class ****
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.Statement;
    public class JDBCUtil {
    public static Connection getOracleConnection(){
    Connection con = null;
    try{
    // Load the driver
    Class.forName("oracle.jdbc.driver.OracleDriver");
    //Establish Connection
    con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","ex","ex");
    }catch(Exception ex){
    ex.printStackTrace();
    return con;
    public static void cleanUp (Connection con , Statement stmt){
    // Release the resource
    try{
    if(con != null){
    con.close();
    if(stmt != null){
    stmt.close();
    }catch(Exception ex){
    ex.printStackTrace();
    Edited by: user12848632 on Aug 13, 2012 2:06 PM

    >
    Can u explain me what's happening in this case ?? And how can i get the updated record also without executing the statement query twice to get the latest result set.
    >
    Sure - but you could have answered your own question if you had read the doc link I gave you in your other thread and next time you post code use \ tags on the lines before and after the code - see the FAQ for info
    17076 : Invalid operation for read only resultset
    {quote}
    •Internal INSERT operations are never visible, regardless of the result set type.
    {quote}
    See •Seeing Database Changes Made Internally and Externally in the JDBC Dev doc I pointed you to
    http://docs.oracle.com/cd/B28359_01/java.111/b31224/resltset.htm#i1024720
    Did you notice the words 'never visible'? You won't see them as part of the result set unless you requery.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • HT2688 Working on a single computer with multiple users, I have set things up to allow each user to view and listen to the others' music libraries under the "Shared Library" function.  Can you then connect an iPod touch and copy music from a shared librar

    Working on a single computer with multiple users, I have set things up to allow each user to view and listen to the others' music libraries under the "Shared Library" function.  Can you then connect an iPod touch and copy music from a shared library?

    Was your wife logged into the libray at the time you tried to log in? I have had a similar problem and it was because another user was logged into the library when I attempted to. I got the permission denied banner.

  • Can you facetime on two iGadgets (pad 2 & touch 4 - both iOS6) with the same apple ID?

    Can you facetime on two iGadgets (pad & touch - both iOS6) with the same apple ID?

    Yes, they can both have the same Apple Id, but you must use a separate device Id.  For the pad and pod that would usually be a different individual e-mail address for each.  If you attempt to use the same e-mail for both, Facetime will not work.  (Its like picking up the phone and dialing your own number)

  • Can you find out last location of iphone if lost and offline

    Can you find out last location of iphone if lost and offline

    No.  The phone must be online to provide a location and a history of locations is only provided if you place it in Lost Mode, and the phone goes online (at least temporarily) to provide it's location.

  • I accidentally bought two subscriptions to convert PDFs to word. Can you combine the two subscriptin

    I accidentally bought two subscriptions to convert PDFs to word. Can you combine the two subscriptions?

    Contact Adobe Customer Care via http://helpx.adobe.com/contact.html?product=export-pdf

  • Can you see which apps are open and/or running like you can on an android phone by going to settings applications running services?

    can you see which apps are open and/or running (like you can on an android phone by going to settings>applications>running services)?

    Hi wjosten,
    thank you for the help.  I should have said I had a iphone 3.  A friend has the same phone and she showed me how she can see what web pages are open when she double taps the home button.  Mine is set to bring up favourites when I double tap (chosen from settings>general>home button).. BUT my choices are only HOME; SEARCH; PHONE FAVORITES; CAMERA or IPOD.  I changed my choice to HOME but that just defeats the purpose as when I am at the home page and double tap nothing happens.  Am I making sense?

  • Barbara Brundage, can you help with PS Elements 11 and Epson R2000 printer issue?

    Seeking help with PS Elements 11 which does not work with Epson r2000 printer.  Epson tech support could not fix, said it is PS e11 problem.  Receive prompt on PS e11 screen when I try to print stating "not compatible or settings are not correct.  Have set PS to manage color and printer manages color to off.  Would appreciate any suggestions.  Thank you.

    Hi,
    Sincerely appreciate your help.  Running Windows 7 on a  Dell XPS420.  System has been very stable for years.  Before purchasing the Epson r2000, I owned an r1800 which was an excellent printer but after seven years started to exhibit paper feed problems.  The r1800 worked with all applications and I was well satisfied with the saturation, contrast, etc. printing mostly 8x10 and 11x17 prints. 
    Thank you for the information about the # of installs for PS E11, will try uninstall/reinstall this morning.
    Will let you know how things go.
    Richard
    Date: Thu, 12 Sep 2013 19:47:38 -0700
    From: [email protected]
    To: [email protected]
    Subject: Barbara Brundage, can you help with PS Elements 11 and Epson R2000 printer issue?
        Re: Barbara Brundage, can you help with PS Elements 11 and Epson R2000 printer issue?
        created by Barbara B. in Photoshop Elements - View the full discussion
    What operating system are you using?
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5678022#5678022
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5678022#5678022
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5678022#5678022. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Photoshop Elements by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Can you have 11.1.1.3 and 11.1.2.3 on the Same Servers

    can you run Different two version of essbase on the Same Servers ????
    I dont thin k this is Best Pratice but Thought I would ask

    Hi ,
    Not yet tried  .I have established multiple instances of essbase as windows services on a single server.This one will be priority to test it out.
    if you have a different vmwares ,then install 11.1.2.3 in vm 1 and configure the shared services .In Vm 2 install the essbase 11.1.1.3 & try to configure with shared services 11.1.2.3.
    11.1.1.3 by default runs on Tomcat where as 11.1.2.3 by default runs on Weblogic.I have not tried this one .This is a sample gesture from my end.
    But in 9.2 version ,I had my 9.2 essbase running in one machine  and in  other machine i had my 9.3.1 shared services running and was configured with essbase 9.2.I was able to provision users from shared services 9.3.1 to 9.2 essbase
    Thanks,
    Sreekumar Hariharan

  • Hello, we have both Creative Cloud and Creative Cloud for teams. Can you help me with the difference and if i need to have both?

    Hello, we have both Creative Cloud membership and Creative Cloud for team. Can you help me with the difference and if i need to have both? We have 9 employees that are using it. Just not sure if i'm paying for something i don't need.
    Thank you

    Please refer to Creative Cloud Help | Creative Cloud / Common Questions
    CC is for retail use with 20 GB of storage space, CCT is where number of seats are purchased & assigned by one program admin where each seat gets 100GB of storage space.
    You can not have both the CC & team in one account as it will only provide you added storage space of 120 GB but you can activate the CC any of them or either of them twice as CC is based on Adobe ID.
    Regards
    Rajshree

  • Hi my name Abukar I had an old apple ID and I had problem with signing it so I decided to make a new apple ID with a new email address, so how can I link with two apple IDs and how can I get back all my previous apps that I purchased before, I cloud stuff

    Hi my name Abukar I had an old apple ID and I had problem with signing it so I decided to make a new apple ID with a new email address, so how can I link with two apple IDs and how can I get back all my previous apps that I purchased before, I cloud stuff

    It is not possible to do that.
    Allan

  • How can you determine a file creation date and know if it's been altered since the creation date

    I need to know how to determine a file creation date on an ipad.  If someone creates a document/note on an ipad how can you tell when it was created and if it has been altered since?

    Unless you are using a third party app that provides that functionality, in iOS the only thing youcan access is the last edit/save date and time, which is fairly evident in the user interface for documents and notes. Some apps that handle MS Office files may provide that, but ican't say first hand.

  • Hi Apple, Can you update the iPod touch 4g and make it have Siri, the fans of Apple wants it :( including me please?

    Hi Apple, Can you update the iPod touch 4g and make it have Siri, the fans of Apple wants it :( including me please?

    You are not addressing Apple here. We are just users like yourself. To make a suggestion to Apple:
    Apple - iPod touch – Feedback
    Per the following the 4G iPod does not have the hardware to adequately support Siri.
    audience technology and siri - Google Search

  • I Want to Buy MacBook Pro 15" In Installments, Can You Tell me The Plans. And I Am Indian So Please tell me Indian plans

    I Want to Buy MacBook Pro 15" In Installments, Can You Tell me The Plans. And I Am Indian So Please tell me Indian plans.. I Am really Excited About My MacBook pro .. Please... Copy Paste All The Information Please Don't Give the Link .. Please... 
    Thanks in Advance
    SANCHIT

    You're asking in the wrong place. This is a user forum and contains no official information from Apple. I suggest you contact an authorized Apple dealer in your country.

Maybe you are looking for