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