No way to cache method results?

hi,
recently I've had quite a few methods in objects that are quite computationally expensive (or I/O expensive), and that the results of consume little memory.
the reaction was to add code like this
import java.util.*;
class A {
   Map arg2result = new HashMap();
   public Object f(Object arg1, String arg2){
      List args = new ArrayList();
      args.add(arg1);
      args.add(arg2);
      if(!arg2result.containsKey(args)){
         Object result;
         ... some work ...
         arg2result.put(args,result);
      return arg2result(args);
}which works great, but having to do this each time you want to cache a method is very tedious!
I've tried using the java.lang.reflect.InvocationProxy to make a proxy that would do this, but now believe its not possible.
The ideal solution might be a new keyword cached?
class A {
   public cached Object f(Object arg1, String arg2){
      Object result;
      ... some work ...
      return result;
}but doing something like
MyObjectType mot1 = new MyObjectType();
MyObjectType mot2 = CacheFactory.cache(mot);would be nice as an alternative. Not having have any class that you want to cache implement an interface of its own method would be a major advantage..
thanks,
asjf

No, you do not need to alter or re-design the classes at all to >conform to any interface. Here's some of what I use, which won't >compile as-is (I just cut out the most relevant parts, that you might >find useful)thanks, I'm getting a ClassCastException with this?
when you say "you do not need to alter or re-design the classes at all to conform to any interface", is this assuming the class already implements at least one interface?
thanks,
asjf
import java.util.*;
import java.lang.reflect.*;
class Fibonacci {
     public int f(int n) {return n<2 ? 1 : f(n-1) + f(n-2);}
public class Cache2 implements InvocationHandler {
     static Map method2arg2result = new HashMap();
     Object o;
     public Cache2(Object o){this.o=o;}
     public static Object wrap(Object o) {
          Class clazz = o.getClass();
          Class[] interfaces = clazz.getInterfaces();
          return Proxy.newProxyInstance(ClassLoader.getSystemClassLoader(), // use SystemClassLoader for now
          interfaces, new Cache2(o));
     public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {          
          if(!method2arg2result.containsKey(method))
               method2arg2result.put(method, new HashMap());
          Map arg2result = (Map) method2arg2result.get(method);
          List realarg = Arrays.asList(args); // array equality is identity equality
          if(!arg2result.containsKey(realarg))
               arg2result.put(realarg, method.invoke(o,args));
          return arg2result.get(realarg);
     public static void main(String [] arg) throws Exception {
          Fibonacci fibonacci = new Fibonacci();
          Object wrapped = wrap(fibonacci);
          System.out.println(wrapped.getClass());
          Fibonacci proxy = (Fibonacci) wrapped;
          time(fibonacci,"Without cache");
          time(proxy,"With cache");
     public static void time(Fibonacci f, String s){
          long time = -System.currentTimeMillis();
          for(int i=0; i<40; i++)
               System.out.print(f.f(i) + (i==39 ? "\n" : ", "));
          System.out.println(s+" "+(time+System.currentTimeMillis())+"\n");
}

Similar Messages

  • Performance problem...is there a way to cache query results?

    Greetings team,
    I've been deploying DS5.2 for a while now, and am on the cusp of pushing it into our production environment, however I've been noticing lately that some hosts are taking an exorbitantly long time to log in (actually, a user noted it, and I'm now investigating).
    Logins to hosts in this environment can take anywhere from 10-50 seconds. One thing that I've noticed is that any time you run a command that requires any amount of awareness of uid->username translation (i.e. if you ls -l /opt/home), queries are made to the configured directory server for this information. Is this normal? Since uid's and usernames don't often change (in most environments, anyway), is there a way this could be cached?
    I see also in my access log for my primary server (configured as a hub, btw) that there is near constant traffic to that host for LDAP info. I'm not sure why it's so chatty, but it does appear to be slowing things down a bit. The load on my LDAP host (a SunFire V210 w/ 1GHz processor, 1024MB RAM) seems to float between 1 and 12, with sar reporting an average idle time of about 44%.
    Any ideas? I'm really at a loss to explain why there's so much traffic to this host when much of it seems to come from hosts with nobody logged into them.
    Patrick

    It is great that you have found the root cause of
    your issue.
    nscd is by default started at boottime by a usual OS
    install. There is a /etc/nscd.conf but I doubt that
    anyone will change anything there as the default
    settings are good for most cases.
    I think LDAP search performance is affected by the
    existence of Search Indexes also.
    I have observed that if the user home directory is
    NFS mounted especially over a WAN, be it via
    /etc/fstab or automount maps, the login process will
    be very slow, it will take a while to obtain a
    command prompt at the home directory level.
    GaryGary et al,
    In my environment nscd has been explicitly disabled for some historical reasons, none of which are still a problem. So, I'm going to enable it for only passwd and group caching, with the default values for those caches.
    I'm in the process of working out my performance tuning plan for my LDAP servers, but I'm definitely going to have an eye on indices and caches. Those will probably have the least impact on search times and such for the moment since my directory is so tiny (261 entries!), but preventing that traffic from hitting the server at all will be a huge savings.
    I can definitely see why WAN mounted homedirs would cause things to lag. That's not the case here since NFS is a big no-no.
    Patrick

  • Caching XQuery Result in OSB for Performance Improvement

    Hi,
    I have written a custom XPath function in Java to pick the IP address of the machine and registered the same with Oracle Service Bus 11g.
    In the Proxy Message Flow, the server IP is picked at run time by using XQuery that refers to the Custom Function.
    Now, is there a way to cache this result some where in OSB so that in the subsequent execution, the XQuery will pick the cached value from Cache instead of making a call to Custom Function registered with OSB.
    I'm asking this question to understand if performance optimization is possible here by caching the result.
    Thanks,
    CC

    Hi All,
    Have implemented Java Callout and Custom XPath in the same flow and kept current datetime stamp before and after each of these steps to calculate the difference b/w timestamps thereby finding the execution times of Java Callout and Custom XPath steps (this may not be an elegant way of calculating the execution time of each step in OSB message flow, request someone to suggest the most recommended approach here!) ...
    For a load of 10 users, each submitting 10 requests (total 100 requests), following are the execution times (in milliseconds) collected for 10 requests (Server is not occupied with any other activity at this time):
    Java Callout(milliseconds) |     Custom XPath(milliseconds)
    13 |     1
    4 |     0
    5 |     1
    1 |     2
    0 |     1
    1 |      0
    1 |     0
    1 |     0
    1 |     0
    1 |     2
    Where the value of '0' is appearing, I assume it could be some micro seconds. The difference happens to be zero in some cases as we don't have microsecond level logging.
    Thanks,
    CC
    Edited by: Chandu on 19-Jul-2011 22:02

  • Portal seems to cache RFC results

    Hi,
    we are calling an RFC in an R/3 4.6C server from an
    EP6 SP9 (sneak preview) using JCA. The call is succesful,
    but the portal seems to cache the call results; i.e. if
    we change the data returned by the RFC the portal receives
    the old values. If we restart the portal the returned data
    changes, but only on the first call.
    I suppose there is some setting for caching RFC results,
    but I am not able to find it.
    Thanks in advance.
    Mattia

    Here it is:
    BAPI:
    FUNCTION zep_test.
    *"*"Local interface:
    *"  EXPORTING
    *"     VALUE(RETURN) LIKE  BAPIRET2 STRUCTURE  BAPIRET2
    *"  TABLES
    *"      T_AVVISI STRUCTURE  ZLIST_AVVISI
      DATA:
          l_wa_avvisi   LIKE LINE OF t_avvisi
      CLEAR return.
      CLEAR t_avvisi.
      REFRESH t_avvisi.
    *  l_wa_avvisi-cdl    = 'E'.
    *  l_wa_avvisi-avvisi = 1.
    *  APPEND l_wa_avvisi TO t_avvisi.
    *  l_wa_avvisi-avvisi = 7.
    *  APPEND l_wa_avvisi TO t_avvisi.
    *  l_wa_avvisi-avvisi = 8.
    *  APPEND l_wa_avvisi TO t_avvisi.
    *  l_wa_avvisi-avvisi = 55.
    *  APPEND l_wa_avvisi TO t_avvisi.
    *  l_wa_avvisi-avvisi = 7.
    *  APPEND l_wa_avvisi TO t_avvisi.
    *  l_wa_avvisi-avvisi = 1.
    *  APPEND l_wa_avvisi TO t_avvisi.
      l_wa_avvisi-cdl    = 'R'.
      l_wa_avvisi-avvisi = 12.
      APPEND l_wa_avvisi TO t_avvisi.
      l_wa_avvisi-avvisi = 30.
      APPEND l_wa_avvisi TO t_avvisi.
      l_wa_avvisi-avvisi = 1.
      APPEND l_wa_avvisi TO t_avvisi.
      l_wa_avvisi-avvisi = 5.
      APPEND l_wa_avvisi TO t_avvisi.
      l_wa_avvisi-avvisi = 10.
      APPEND l_wa_avvisi TO t_avvisi.
      l_wa_avvisi-avvisi = 27.
      APPEND l_wa_avvisi TO t_avvisi.
      l_wa_avvisi-cdl    = 'M'.
      l_wa_avvisi-avvisi = 13.
      APPEND l_wa_avvisi TO t_avvisi.
      l_wa_avvisi-avvisi = 7.
      APPEND l_wa_avvisi TO t_avvisi.
      l_wa_avvisi-avvisi = 8.
      APPEND l_wa_avvisi TO t_avvisi.
      l_wa_avvisi-avvisi = 10.
      APPEND l_wa_avvisi TO t_avvisi.
      l_wa_avvisi-avvisi = 2.
      APPEND l_wa_avvisi TO t_avvisi.
      l_wa_avvisi-avvisi = 34.
      APPEND l_wa_avvisi TO t_avvisi.
      return-type = 'S'.
    ENDFUNCTION.
    The component is a variation of the jca.SampleComponent.par I found either on SDN or in a note (sorry, I can't seem to find it anymore). I only
    changed the doJca method (below).
    public void doJca(IPortalComponentRequest request, IPortalRequestEvent event) {
        System.out.println("doJca()");
        Context ctx = null;
    //    IConnectionFactory connectionFactory = null;
        IConnection client = null;
        ConnectionProperties prop = null;
        String rfm_name = "ZEP_TEST";
        String system_alias = request.getParameter("system");
        if (system_alias == null) {
                   app.putValue(
                        "error",
                        "Couldn't establish a connection with a target system " + system_alias + ".");
                   return;   
        System.out.println("system_alias = " + system_alias);
        app.putValue("error", "");
        app.putValue("exportParams", "");
        app.putValue("system_alias", system_alias);
        try {
          // Obtain the initial JNDI context
          //   ctx = new InitialContext();
          // Perform JNDI lookup to obtain connection factory
          //   connectionFactory = (IConnectionFactory) ctx.lookup("EISConnections/SAPFactory");
          //   IConnectionSpec spec = connectionFactory.getConnectionSpec();
          //   ((Map) spec).put("client", "100");
          //      ((Map) spec).put("UserName", "");
          //      ((Map) spec).put("Password", "");
          //      ((Map) spec).put("logonmethod", "UIDPW");
          //      ((Map) spec).put("Language", "EN");
          //      ((Map) spec).put("ashost", "");
          //      ((Map) spec).put("sysnr", "01");
          //      IConnection client = connectionFactory.getConnectionEx(spec);
          IConnectorGatewayService cgService =
            (IConnectorGatewayService) request.getService(IConnectorService.KEY);
          try {
                        prop = new ConnectionProperties(request.getLocale(), request.getUser());
          } catch (Exception e) {
                        app.putValue(
                             "error",
                             "Couldn't establish a connection with the user " + request.getUser() + "." + e);
                        return;     
          try {
                        client = cgService.getConnection(system_alias, prop);
          } catch (Exception e) {
                    StringWriter wr = new StringWriter();
                    e.printStackTrace(new PrintWriter(wr));
                        app.putValue(
                             "error",
                             "Couldn't establish a connection with a target system " + system_alias + "." + wr.toString());
                        return;
           * Start Interaction
          IInteraction interaction = client.createInteractionEx();
          System.out.println("Starting Interaction...");
          IInteractionSpec interactionSpec = interaction.getInteractionSpec();
          interactionSpec.setPropertyValue("Name", rfm_name);
           * CCI api only has one datatype: Record
          RecordFactory recordFactory = interaction.getRecordFactory();
          MappedRecord importParams = recordFactory.createMappedRecord("CONTAINER_OF_IMPORT_PARAMS");
          IFunctionsMetaData functionsMetaData = client.getFunctionsMetaData();
          IFunction function = functionsMetaData.getFunction(rfm_name);
          if (function == null) {
            app.putValue(
              "error",
              "Couldn't find " + rfm_name + " in a target system " + system_alias + ".");
            return;
           * How to invoke Function modules
          System.out.println("Invoking... " + function.getName());
          MappedRecord exportParams = (MappedRecord) interaction.execute(interactionSpec, importParams);
          app.putValue("exportParams", exportParams);
           * How to get structure values
          IRecord exportStructure = (IRecord) exportParams.get("RETURN");
          String columnOne = exportStructure.getString("TYPE");
          String columnTwo = exportStructure.getString("NUMBER");
          String columnThree = exportStructure.getString("MESSAGE");
          System.out.println("  RETURN-TYPE    = " + columnOne);
          System.out.println("  RETURN-CODE    = " + columnTwo);
          System.out.println("  RETURN-MESSAGE =" + columnThree);
           * How to get table values
          IRecordSet exportTable = (IRecordSet) exportParams.get("T_AVVISI");
          exportTable.beforeFirst(); // Moves the cursor before the first row.
          while (exportTable.next()) {
            String column_1 = exportTable.getString("CDL");
            String column_2 = String.valueOf(exportTable.getInt("AVVISI"));
            System.out.println("  COMPANYCODE_LIST-COMP_CODE = " + column_1);
            System.out.println("  COMPANYCODE_LIST-COMP_NAME = " + column_2);
           * Closing the connection
           interaction.getConnection().close();
          client.close();
        } catch (ConnectorException e) {
          app.putValue("error", e.toString());
          System.out.println("Caught an exception: n" + e);
          throw new RuntimeException(e);
        } catch (Exception e) {
          app.putValue("error", e.toString());
          System.out.println("Caught an exception: n" + e);
          throw new RuntimeException(e);
      When I uncomment the commented section in the BAPI
    (or I comment out some more of it), the result displayed
    by the iView does not change until I restart the portal.
    Thanks in advance!
    Mattia

  • I'm wondering if there is any way to view the results of the form other than in a spreadsheet?  Is it possible to print responses one by one in PDF format, or word, etc?  I'd like to create a form for proposal applications, and the spreadsheet format resu

    I'm wondering if there is any way to view the results of the form other than in a table?  Is it possible to print responses one by one in PDF format, or word, etc?  I'd like to create a form for proposal applications, and the spreadsheet format results are nearly unusable for this type of form.

    Hi Nalani500 ,
    Yes, you can print the response in a PDF by following the steps suggested below.
    1) Go to the response file
    2) Select the response you want to print
    3) Click on Save as PDF button and it would save the selected response in PDF format.
    Thanks,
    Vikrantt Singh

  • I've found no way to sort.  For example, if I type the group "Rush" into the search bar, I get a list of songs recorded by rush and literally thousands of other songs and artists with the word rush in them. There is; however, no way to sort the results.

    I've found no way to sort search results in itunes.  For example, if I type the group "Rush" into the search bar, I get a list of songs recorded by rush and literally thousands of other songs and artists with the word rush in them. There is; however, no way to sort the results. 

    In the Search box click on the black Arrow and UNTICK the Search Entire Library.
    Then the Search results in Songs view will be displayed in the main Grid and you can sort them by clicking on the column headers.
    You can also turn on the column browser which can help with filtering

  • Caching XSLT results?

    Hi,
    I am a newbie to XML/XSLT, and we have just written our first XSL stylesheet.
    I am using the WebLogic JSP Tag Library to do the transformation from XML to HTML
    and all seems to work well. My question is this: Does WebLogic cache the HTML
    somewhere so that the transformation does not need to be reperformed each time
    the page is requested by the user? It sounds like an obvious thing to do, but
    I'm not sure if this functionality is included in WebLogic. If it is not, are
    there others out there who have this same need (to cache XSLT results for performance
    reasons) and how have you dealt with this issue. Any help would be appreciated.
    I'm running WLS 6.0 SP2 on HP-UX 11.x. Thanks...
    Vasuki.

    I tried this example based on a view:
    CREATE MATERIALIZED VIEW MV_TEST2
         REFRESH COMPLETE
         START WITH SYSDATE
         NEXT  SYSDATE + 1/48
         WITH ROWID
         AS SELECT * FROM test1;REFRESH COMPLETE -- The complete refresh re-creates the entire materialized view.
    START WITH SYSDATE -- run now
    NEXT SYSDATE + 1/48 -- run again in half an hour
    WITH ROWID -- I think this option is important if you use partial refresh of the view.
    AS SELECT * FROM test1; -- test1 is a view:
    CREATE OR REPLACE VIEW TEST1 AS
    SELECT st_id, st_name
        FROM aaw_solution_tree;Are column indexes still possible? I'm not sure:
    Indexing: !with respect to MV's on 10gR2 Jonathan Lewis wrote! ... you are allowed to create indexes on the tables that sit under materialized views - just don't make them unique indexes
    How much freedom is there in setting the refresh rate?
    What type of refreshing do you need?
    Another useful link: [http://asktom.oracle.com/pls/ask/search?p_string=materialized+view|http://asktom.oracle.com/pls/ask/search?p_string=materialized+view]
    Hope it helps.
    Tobias

  • Cannot query using both conforming and cached query result

    TopLink doesn't allow me to both use conforming and cached query result at the same time.
    Conforming is certainly not a superset of the [cached query result] features.
    Can you confirm that it's a limitation of TopLink?
    Any know workaround to end-up with the same features as using both conforming and cached query result?
    Conforming is about seeing modifications you do in the same transaction. As a bonus, if you query for one object and specify at least the id as criteria because TopLink will have to check in memory anyway it can avoid going to the database.
    But if I do a query like "give me employees hired before now and after 30 days ago" it's about more than one objects and about finding existance so cached query result is needed to get acceptable performance in a complex application trying to avoid the same SQL generated over and over again.

    Thats where the trace just ends? It doesnt look like there's any LIKE or filtering going on (with respect to the Oracle pieces anyway), apparently MSAccess simply requested the whole table.
    What do you mean by 'hang' exactly? Are you sure it's just not taking a long time to complete? How long have you waited? How fast does it complete on the other environment?
    ODBC tracing isnt likely to help much for that. SQLNet tracing would be better to see what is going on at a lower level. Specifically, what is going on at the network level? Is the client waiting for a packet to be returned from the database?
    Is the database having a hard time processing the query, perhaps due to index/tuning issues?
    Assuming that is indeed the query that is "hung", how much data does that return?
    Are you able to reproduce the same behavior with that query and vbscript for example?
    Greg

  • cache-query-results question

    I have another post for general descriptor tag information but I do have a specific question. In a project I am looking at I see:
    <cache-usage> check cache by primary key </cache-usage>
    <cache-query-results>false</cache-query-results>
    <maintain-cache>true</maintain-cache>
    I'm not sure how to interpret this. Does this mean that a cache is in place or not? cache-query-rests is set to false which implies no caching, yet the other parameters imply a cache is in place. What overrides here?
    Thanks

    The XML maps directly to the API so the JavaDocs and related documentation are the best tools:
    cache-usage: query.setCacheUsage(int)
    This option indicates how the object cache should be used when processing the query. This is how in-memory query is configured as well as support for cache-hits on ReadObjectQuery.
    cache-query-result: query.setShouldCacheQueryResults(boolean)
    This option allows you to indicate that the results returned from the query execution should be held. When the query is executed again these results will be returned without going to the database or searching the object cache. This is just caching the results locally within the query.
    maintain-cache: query.maintainCache() or query.dontMaintainCache()
    This setting determines if the results returned from the query should be cached in the shared object cache. It is on by default and turning this off is very rare. Occasionally done to compare the cache version with the database verision when handling an optimistic locking failure.
    Doug

  • Caching query results?

    Hi guys,
    I have this page which calls the same query (across a database link!) four times! First when an initial LOV is generated (and the page is loaded), again for another LOV based off the initial one and finally for the report generated based off the 2 selections. This is crazily slow (30-40 seconds each load~) and also: When you try to sort with an Interactive Report by clicking the column names it then queries the database again (I assumed this part was cached but apparently not). I therefore need to cache the results from an initial query and then just limit the results locally. How can I do this? Guides? Examples?
    Thanks for help.
    Mike

    I tried this example based on a view:
    CREATE MATERIALIZED VIEW MV_TEST2
         REFRESH COMPLETE
         START WITH SYSDATE
         NEXT  SYSDATE + 1/48
         WITH ROWID
         AS SELECT * FROM test1;REFRESH COMPLETE -- The complete refresh re-creates the entire materialized view.
    START WITH SYSDATE -- run now
    NEXT SYSDATE + 1/48 -- run again in half an hour
    WITH ROWID -- I think this option is important if you use partial refresh of the view.
    AS SELECT * FROM test1; -- test1 is a view:
    CREATE OR REPLACE VIEW TEST1 AS
    SELECT st_id, st_name
        FROM aaw_solution_tree;Are column indexes still possible? I'm not sure:
    Indexing: !with respect to MV's on 10gR2 Jonathan Lewis wrote! ... you are allowed to create indexes on the tables that sit under materialized views - just don't make them unique indexes
    How much freedom is there in setting the refresh rate?
    What type of refreshing do you need?
    Another useful link: [http://asktom.oracle.com/pls/ask/search?p_string=materialized+view|http://asktom.oracle.com/pls/ask/search?p_string=materialized+view]
    Hope it helps.
    Tobias

  • HT200241 Is their a way to cache the ios8 file when using the apple configurator to load MDM on ios devices iphones/ipods

    I am loading mobile iron mdm solution on my devices and the configurator is checking and installing ios8 on devices even if they are already up to date and its taking 30 minutes per device. Is their a way to cache the ios8 file so this process is shortened?

    I'm not gonna do a complete reset because I shouldn't have to . Apple put out a very buggy update .
    I am not ranting about your suggestion , which is fine , but these are ridiculous issues for an operating system that been out for years .

  • Cache database results within any of your software applications?

    Have you had to cache database results within any of your software applications? What are the advantages and pitfalls developers should be aware of when caching database results.
    plz reply....
    ........thnks.

    We have cached the database results in client side cache (partially in arrays and in files on OS as well). But this caching is restricted to purely STATIC data (which undergoes no change under any circumstances).
    Our application relies a lot on static data and we managed to reduce 10% of network bandwidth with this implementation.
    We tried using client side cache for not-so-static data but had lot of issues related to refresh of the same so we reverted that change.
    On a side note, this does remind me of the client result cache available in Oracle 11g.
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28279/chapter1.htm#FEATURENO06989
    See if it helps you.

  • Alt ways to view quiz results

      Hello, I was wondering if there was an alternative way to view quiz  results. I know that you can view data through the app that comes with  captivate however I would like to view my data on the web and mabey style it a bit differently. What do you  guys think the best solution for that would be?
    Thanks

    Unless you're willing to implement Moodle or some other web-based LMS, you would need to build your own web-driven database solution.  If you're a web developer with database and web scripting skills, this should be doable.  If you're an average Captivate user, it's probably outside your abilities.

  • Is there a way to cache documents in JEditorPane ?

    I am using a JEditorPane to load html pages.
    some of my pages are quite big and take some time to load. I would like to cache the pages so the next time the user loads a cached page, the page will load very quickly.
    It seems that what I need to cache is the html document that represents the model. However using JEditorPane setDocument( ) method with the cached document takes the same time as loading a new page.
    so perhaps i need to cache the views also ?
    thanks.

    1. I load documents only from the local drive.
    2. The pages I load can be quite big.
    3. I load the pages synchronically
    I have measured a bit of times for loading a big page.
    when the page is new it takes 11 seconds to build the document. with a cached document it takes about 7 seconds.
    the painting of the views takes little time.
    my question is: if I supply the editor pane with a fully built document model, why does it still take him 7 seconds to ready it?
    or if someone knows a way to load a cached document instead of using the setDocument( ) method.
    Thanks

  • What is the best way to output query result in jsp page?

    I have several pages with 2-3 queries on each one.
    My jsp pages call a class that I've created, the class will create a connection with the db, execute the query and returns the ResultSet to the jsp page. Then I iterate the RS on the jsp page.
    Is there a better way of sending the data back to the jsp? I was thinking of .xml.

    Send it back as a java.util.List, or some other Collection. Then iterate through the collection. My preference is to make a Bean of the date that represents a Row on the ResultSet and put those in the List. Then when we get to the JSP, iterate the List to get the beans, and call get methods to get the values...
      /* In a method that traverses ResultSet and fills a List of  beans... */
      List data = new ArrayList();
      while(results.next())
        MyBean mb = new MyBean();
        mb.setProperty1(rs.getString(1)); //But give properties good names
        mb.setProperty2(rs.getString(2)); //Not 'Property1 and Property2
        data.add(mb);
      return data;If you are using JSTL you can do something like this:
      <c:set var="myBeans" value="${theDbObject.results}"/> //Assuming the above method was called 'getResults()'
      <table>
      <c:forEach var="mb" items="${myBeans}">
        <tr><td>${mb.property1}</td><td>${mb.property2}</td>...</tr>
      </c:forEach>
      </table>

Maybe you are looking for