Chee;
We have implemented a global cache in the form of a
servlet. Our other servlets all inherit methods that
get a hanlde to our global cache servlet and it has a
series of hash tables to cache data. It works ok.
Let me know if you need some sample code.
//Nicholas
--- Chee Keong <[EMAIL PROTECTED]> wrote:
> I am interested in cache the contents of a few
> tables (which have about 20
> records each) to memory.
>
> For instance, I want to cache the an error table
> which have the folowing
>
> FIELD TYPE
> ----------- -----
> ERR_CODE INT
> SHORTDESC VARCHAR
> DET_DESC VARCHAR
>
> . I also want to cache other table which may have
> another schema.
> For example, maybe I want to store a table to store
> information on
> departments in a big organization
>
> FIELD TYPE
> ----------- -----
> SUBSIDARY VARCHAR
> DEPT_NAME VARCHAR
> LOCATION VARCHAR
> EMPLOYEES INT
>
> The client would then use the global object in the
> following way
> to get the row for the error code.
>
> GlobalObj myobj = new GlobalObj();
> myobj.setTableName("Error");
> myobj.setkeyfields("ERR_CODE");
> String[] row = myobj.getRows("ERR101");
>
> The client would then use the global object in the
> following way
> to get the row for the error code.
>
> GlobalObj myobj = new GlobalObj();
> myobj.setTableName("DEPT");
> myobj.setkeyfields("SUBSIDARY|DEPT_NAME"); // using
> | as delimeter char
> String[] row = myobj.getRows("FASTFOOD|FINANCE");
>
> There are some weakness in this approach is that the
> Java
> application have to do some formatting to extract
> out the data.
>
> If possible, is there already some classes that does
> this can provide
> some JDBC like interfaces to access the cached
> tables data in memory?
>
> Have anyone done this sort of thing? Any suggestion
> or sample code
> would be very much appreciated.
>
> Thank you.
>
> Regards,
> Chee Keong
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED]
> and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives:
>
http://archives.java.sun.com/archives/servlet-interest.html
> Resources:
>
http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help:
> http://www.lsoft.com/manuals/user/user.html
>
=====
--
Nicholas Whitehead
Marketwide Software & Consulting Inc.
[EMAIL PROTECTED]
Home: 973 377 9335
Current Office: 212 559 9314
__________________________________________________
Do You Yahoo!?
Thousands of Stores. Millions of Products. All in one place.
Yahoo! Shopping: http://shopping.yahoo.com
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html