> List of tutorials for developing a Fat-Client

Index of Basic knowledge for developing Fat-Clients with Java

Code for the Base-Class for a Data-Base-Access (DBA) Object to get a set of date - Fat-Client-Development

* For this document and all references (links) please obey the hints and regulations concerning copyright, disclaimer and trademarks.

  • The owner of this web-site (www.javascout.biz) is not responsible for the content of web-sites linked within this document or other documents of www.javascout.biz.

  • If this document or other documents of this web-site (www.javascout.biz) infringes your rights or you think that rights of others (third parties) are infringed, please inform the author.
    An e-mail can be sent by clicking onto the 'hungry mailbox' in the upper right corner.

Last revision of this document:
2006-11-16

This is document contains the code for Class JSBS_DBA_Set.
For easy 'cut and paste' ;-)

For an overview of the idea of Data-Base-Access Objects please refer to Using Business Objects to handle data-storage and -retrieval .

package js_base.dba;

import java.util.*;
import java.sql.*;


/**
 
*
 * @author
kurt@javascout.biz
 * @date 2006-11-16
 *
 * @description
 *  Base-Class for Data-Base-Access (DBA) Objects holding sets of data-records.
 *  This class can be inherited by DBA_Set Objects designed for a dedicated database-table.
 
*
 * @change-log
 * when         who               why
 * --------------------------------------------------------
 *
 */

public class JSBS_DBA_Set {
/*
 * Vector holding the set of read data-records.
 * This variable does not define the structure of the vector content;
 * the conversion has to be done within the class inheriting this base-class.
*/
    
public Vector vecRecordSet = new Vector();
/*
 * String with a possible Error-Message from the database system.
*/
    
public
String ErrorMsg = "";
/*
 * Values in java.sql.Date format to compare the validity range of the read record
 * with the 'actual' date passed as value in the structure JSBS_MinimalParameters.
*/
    
protected
java.sql.Date locdteReadValidFrom;
    protected java.sql.Date locdteReadValidTill;
    
protected java.sql.Date locdteActualDate;
/*
 * --------------------
 * Method to compare if a given date is within a date-range.
 * Necessary in all derived methods. */
    
protected boolean isWithinDateRange(java.sql.Date parmActualDate,
                                        java.sql.Date parmValidFrom,
                                        
java.sql.Date parmValidTill
) {
/* Convert from the format java.sql.Date to a comparable format,
 * compare and return the result. */
/* 
 * The first comparison checks, that the data-set was not terminated at the actual date;
 * the second comparison checks, that the data-set does not start in the future. */

      return ((parmValidFrom.getTime() <= parmValidTill.getTime())
              || (parmValidFrom.getTime() <= parmActualDate.getTime()));

    
}

}