Is is possible to hold resultset in session

Hi All,
Is is possible to hold resultset in session. I'm having a client GUI, which request the servlet and the servlet inturn queries the db. The resultset i'm getting in the servlet can be used for some more requests from the client. So i would like to have that resultset in session so that i can avoid getting it from db everytime. Can anyone tell me whether it is possible to hold the resultset in session??

If you absolutely have to do this thing this way (sorry, but it sounds pretty poorly planned to me), you could download the ResultSet values to some "client-side object". For example in the servlet use a Vector of Vectors to hold the results in the returned result set:
Vector row = null;
Vector rows = new Vector();
ResultSet rs = ...;
int numColsInRS = rs.getMetaData().getColumnCount();
while (rs.next())
    row = new Vector();
    for (int i = 1; i <= numColsInRS; i++)
        row.add( rs.getObject(i).toString() );
    rows.add( row );
rs.close();
rs = null;
...

Similar Messages

  • Is it possible to connect database using session bean

    Dear all,
    Is it possible to connect database using session bean without using entity beans like cmp,bmp.
    if ur answer is yes, then pls tell me where to put the select statement and transaction attribute like(6 types).
    if u have sample code, then it is good for me.
    Hope I will get answer.

    Sure it is.
    Try something like this (and maybe get a book on JDBC):
    String name;
    try {
         InitialContext ic = new InitialContext();
         DataSource ds = (DataSource) ic.lookup(Constants.MY_DATASOURCE);
         Connection connection = ds.getConnection();
         String sql = "SELECT * FROM TABLE";
         PreparedStatement statement = connection.prepareStatement(sql);
         ResultSet rs = statement.executeQuery();
         while (rs.next()) {
              name = rs.getString("NAME");
         if (rs != null)
              rs.close();
         if (statement != null)
              statement.close();
         if (connection != null)
              connection.close();
    catch (NamingException e) {
         // Can't get JDBC datasource
         // ... do something with this exception
    catch (SQLException e) {
         // SQL exception from getter
         // .... do seomthing with this one too
    }

  • Hi I have two questions. I am using NAS 4.1 and was wondering is it possible to set a different session timeout for different users? How is the session timeout set? Thanks, YS

     

    <i>I am using NAS 4.1 and was wondering is it possible to set a different session timeout for different users?</i>
    Um, there is no such thing as NAS4.1.
    I'm assuming that you mean NAS4.0 (maybe NAS4.0sp1?). If so, then the session timeouts are specified in the session section of the NTV configuration files.
    AFAIK, you can specify session timeouts on a per user basis.

  • Is it possible to hold the HR postings in FI

    .Dear experts,
    could you please help me out regarding the following issue.
    is it possible to hold the HR postings in FI if possible send me the procedure if not give me some reasons.

    i want to hold at document level in FI
    for Eg: to day am going to post the document through HR to FI but the employer will make the pmt in the next month for the particular employee for time being we need to hold the document in FI... if u know the procedure plz let me know

  • Can I store ResultSet in Session

    My resultset contains 2000 records, Is it safe to put the ResultSet in session.
    Now for 1 user the server contains 2000 records in session, and for 10 users the server will
    contain 20000 records in session, and so on... This is causing a heavy time delay.
    What can I do now, can I use HashMap to store 2000 records and put the HashMap in session, Is it advisable.....
    Anyone pls help me,....
    Thanks in advance,
    viswa

    Actually I am getting the ResultSet from Database,
    passing it to a Bean, and storing there as ResultSet with session scope.
    Since i am storing 2000 records, the server is becoming slower as many user logs in.
    What I want is can I store the ResultSet in HashMap inside a Bean with Session scope.
    By doing this can I solve my performance problems.
    Thanks in advance,
    viswa

  • Is it possible to Hold a WF?

    Hi,
    Is it possible to hold a WF for an hour and then activate it based on the output of another WF?
    I could appreciate if I get help from any one.
    Thanks,
    Ilayarajan

    Hi,
    It is possible to hold a WF if you use the manual actions option among the action types option specified. After selecting action type as manual in the screen that follows set the value of time out field to One hour. Preceed the value with + if u r setting it in minutes (or) - if u r setting it in seconds.
    In this case workflow will wait for any action to be taken (eg. approval) till the timeout period and once timeout is reached it can exit/close or proceed to a different workflow/subprocess (as you said).
    This is because when you specify a particular action as manual action it a WorkItem is created which will remain and hold the workflow till the action is approved/timeout limit is reached.
    Anybody can correct me if I am wrong somewhere.
    Ilayarajan: I hope i answered your question
    regards,
    Zebra8

  • Translucent impromptu possible "hacker" message interrupts current session, locks MacBook Pro screen and demands that I restart by holding down the power button of my LapTop to turn it off first. Any thought? Could this be another way to mess with us?

    I was listening to a YouTube video on the history of X15 rocket airplanes. All of sudden, out of the blue a translucent back message drops top down, stops the video, locks up my MacBook Pro screen and demands that I restart my lapTop by first holding down my power switch, then turn the lapTop back on. This has never happened to me before. The message was in black & white, and in about 6 languages: English, French, Spanish, Dutch, Japanese, Chinese. Does any one recognize what this might be?
    The Computer turned back on just fine as if nothing had Now I am freeking out that they could be reading my key strokes or something. Could they have used this tactic to install malicious software on my computer by first taking away my ability to do anything about it being that I am not a software engineer? Can any one think of anything simillar? I reported this as a bug to APPLE the regular way, then cleared my Safari cookies, then run software update which returned nothing new as in " your software is up to date at this time."
    Can any one please help?
    A-NmN. 

    Hi stedman1,
    Thank you so much. This seems to make sense to me now. I was freaking out a bit that some hacker could be messing with my MacBook Pro. I will be monitoring this issue from now on as it has never happened before. 
    A-NmN.

  • Is it possible to set up a session with an expert for a team?

    I'm the administrator for a small CC team. While a couple of us are fairly comfortable with the Adobe suite, we're bringing in a few single-app subscribers who need to learn the basics (InCopy specifically). Is it possible to set up a group session with an Adobe expert, i.e. a conference line we can dial in to, so that we're all on the same page?

    Certainly you can setup an expert session. Please go through the link below to setup a session with Adobe experts.
    https://helpx.adobe.com/creative-cloud/team/creative-cloud-teams.html#
    Hope this helps.
    Thanks,
    Ashish

  • Is possible to keep alive 2 sessions at the same time?

    Hi all,
    we have developed a web application deployed on a J2ee server.
    The navigation information (username, department) is kept in Cookies.
    Now our customer has asked if it's possible to login in 2 separate IExplorer browser with different users.
    I have excluded this possiblities since the cookie in the second browser will overwrite the cookie from the first and viceversa......
    What do you think ? is there a way you can discover from which browser the request is coming ? is there a hack to do it ?
    Thanks a lot
    Francesco

    fmarchioniscreen wrote:
    Hi all,
    we have developed a web application deployed on a J2ee server.
    The navigation information (username, department) is kept in Cookies.
    Now our customer has asked if it's possible to login in 2 separate IExplorer browser with different users.
    I have excluded this possiblities since the cookie in the second browser will overwrite the cookie from the first and viceversa......
    What do you think ? is there a way you can discover from which browser the request is coming ? is there a hack to do it ?
    Thanks a lot
    FrancescoSaving critical user information in cookies is not a good practice.Please divert your approach to scoping it in session to fix your problem.
    usage of session.set/getAttribute() accordingly.
    Hope that might help :)
    REGARDS,
    RaHuL

  • [SOLVED] Is It Possible to Create a Telnet Session in URXVT?

    Greetings-
    Just curious if anyone can tell me how to create a telnet session via rxvt. I saw a thread on here where someone said that it's possible, but I can't find any documentation on it. Just wanted to try it out to connect to my switch which I normally connect to from a tera term emulator.
    Thanks guys!
    Last edited by w201 (2013-10-03 23:57:02)

    ewaller wrote:
    Just run:
    telnet the_address_of_your_switch
    Or I missing something profound?
    Well it was profound to me until you just showed how easy it is. The magic of learning eh?
    Thanks.

  • Is it possible to reconnect a scout session?

    Hi, I'm interested in telemetry data after turning on an app on a device but the scout session is closed after going to the background mode on a device.
    Is it possible to start a session while running an app?

    Oh! Unfortunately, cookiepie is not what I'm seeking.
    How about managing the session without the JSESSIONID cookie?
    Can't the session id be put in the url? Is that a security risk? Even for https?

  • Remote Access - Screen Sharing - possible to have a different session?

    I was wondering of there was some way, maybe using X11, of doing screen sharing to my iMac but with a different session.
    Can I log-in across the network and get a separate logged-in session from the one on the main screen?
    If so, how do I do it? Is there a 'How to' somewhere?
    I'd imagine something like setting up a Display parameter for X11 that can run remotely on my machine, so I can log on as a different person and run a different session without affecting what's on the main screen. Effectively to be multi-user access.

    On a Unix or Linux system (and OS/X is a Unix system) you can have multiple remote sessions running under X11.
    Mac OS X does NOT use X11 as its graphic engine. X11 is a side car on Mac OS X, provided so users that need to access Linux/Unix system which do use X11 have a way of displaying X-Windows output.
    Mac OS X itself does not use X11 in any way. So even if you could do what you want, it would not get any of the native Mac OS X applications displayed on your system.
    As someone else has pointed out, there is a trick with Fast User Switching and the Vine Server that can allow multiple users to access the system. It is a bit of a hack, and less than perfect, but if it works for you, that might be an option.

  • Is it possible to get a unique session per browser window?

    I'm playing with the idea that each browser window may have it's own unique session.
    So, if I have two or more IE browsers open and I point each one at my web site, I want each window
    to maintain their own session id. Same if I have two or more Firefox browsers open, etc ...
    I see a sesion id is stored in the JSESSIONID cookie. It seems browsers of the same make share this cookie.
    So, you cannot keep sessions separate. Is there a way to get around this?
    Why do these sessions need to be shared across browser windows of the same make?

    Oh! Unfortunately, cookiepie is not what I'm seeking.
    How about managing the session without the JSESSIONID cookie?
    Can't the session id be put in the url? Is that a security risk? Even for https?

  • Is it possible to hold the last note of a soundtrack?

    I have a fourteen second music loop that I'd like to hold the last note. Obviously, it's designed to be edited into a loop or larger sequence of similar music clips. I'm hoping there is a way to extend the final note of the piece so that it 'resolves' at the end. Is there a way to do this? Maybe something like time remapping in Final Cut Pro?

    Answered my own question. I used the file editor and the *audio stretching tool*. I just selected the section of the song that I wanted to 'hold' and then grab the end of the selected area with the audio selection tool and drag it to the desired length. Works great.

  • Possible piggyback on a remote session?

    Hello, I was working remotely on a computer over the internet. I had ARD 3.1 on 10.4.9, and client has 3.1 well on 10.3.9.
    I just finished setting Dyndns, and this was also only the second time I remotely logged in. Well I stopped typing and just stared at the screen and knew that the person I was helping went away from the computer. I was talking to them on the phone.
    After about 3 minutes of idle. I saw a safari window get pulled up, and whatismyip.com get typed in on the client computer.
    I immediately verified that the user I was working with was not on the computer over the phone.
    I immediately told the user to stop sharing in the System Preferences, restart without the ethernet cable plugged in, and to change the admin password. I also deleted Dyndns host to that computer.
    Did we do enough to secure that computer? Is there a more secure way to work remotely on a client over the internet? Did I overlook something when setting this up leaving a hole for someone?
    Thanks for taking a look. I would appreciate any advice and/or feedback.
    Powermac G4   Mac OS X (10.4.9)  

    The wol 'magic packet' is sent to a broadcast address on the local subnet. In order to make that work for a remote computer, you would have to be 'inside' the network on a VPN or 'ssh' session.

Maybe you are looking for

  • Dynamically change infile value in controlfile

    Hi, I am loading some data from multiple files from a Windows Client using sql*loader. Is there any way i can dynamically pass the csv file name to the infile parameter in the control file, in windows client. what scripting is required ? Any help wit

  • MyPC Backup.exe-Entry Not Found

    how can i fix or reinstall please?

  • How to fail a message based on payload?

    Hi Experts, Currently Iu2019m working on IDOC2JDBC scenario wherein the customer master details needs to be send from CRM system to Oracle system. My question is there are two fields at source side Postal code and Tax and my requirement is, if any of

  • Changing the accounts used to run Service Applications

    We would like to install SharePoint 2013 using seperate accounts for different service apps (meaning seperate App Pools, presumably) Is there a concensus on what is the better approach: 1.Create the basic Sharepoint config using AutoSPInstaller, but

  • Flash advanced photo album

    hi i have created the album successfully with my pictures, but i would like to know how to remove the autostart from the code. i want to do this becasue i am putting it on the website with a couple other albums and they all start to play at once. ple