<< Technical [35/117] >>

Technical


Home / Projects / JSP-MemCounter / Technical

JSP-MemCounter: Technical



Tables
The data base consists altogether of 3 tables:

TABLE CounterMain (
    Timestamp datetime not null,
    URLID integer not null,
    Visitors integer not null,
    PageClicks integer not null,
    CommentID integer not null);
TABLE CounterURL (
    URLID integer not null unique,
    URL varchar(255) not null );
TABLE CounterComment (
    CommentID integer not null unique,
    Comment varchar(255) not null);

In order to save space in the data base, the URL's and the Comment's are referenced by CounterMain over ID's in CounterURL and CounterComment.
A data base entry is represented internally over a Java-object "DBEntry", which nothing knows (independence) from the correlations (URLID, CommentID).
Filter inquiries A filter inquiry to the data base is accomplished internally over a Java-object "DBEntryInfo", which contains the inquiry criteria. Then all "DBEntry" are filtered - which match the inquiry object "DBEntryInfo".
Update of entries With an update of entries two DBEntry objects are produced. First contains the old entry, second the new data for this entry. Over an update method the data are then changed.

CounterDatabase.java
All changes run over this class. Thus there are the following methods, which return the success status of the action usually over boolean variables:
void createTables();
boolean connect ();
boolean disconnect ();
boolean makeDBEntry (DBEntry dbEntry);
boolean removeDBEntry (DBEntry dbEntry);
boolean updateDBEntry (DBEntry dbEntryOLD, DBEntry dbEntryNEW);
Vector getDBEntries (DBEntryInfo dbEntryInfo);
boolean createBackup (String filename);
boolean restoreFromBackup (String filename);


Visitors PageClicks Valid XHTML 1.0! Valid CSS!

CanciAbout meSite-MapRightsContactJSWins (JavaScript-Desktop-System)© 2004-2013 by Markus Krebs