001 /*************************************************************************************************** 002 * MODULE DESCRIPTION 003 **************************************************************************************************** 004 * 005 * NAME: Field.java 006 * LANGUAGE: Java2 007 * DATE: 25.3.2003 008 * AUTHOR: Miika Nurminen, Jyväskylän yliopisto 009 * 010 **************************************************************************************************** 011 * COPYRIGHT (C) KIURU -PROJECT GROUP 012 * Limited rights granted. Please refer to license. 013 **************************************************************************************************** 014 * 015 **************************************************************************************************** 016 * UPDATES 017 **************************************************************************************************** 018 * 019 * 25.3.2003 Initial release 020 * 021 ****************************************************************************************************/ 022 package kiurubeans; 023 import kotkabeans.RS2; 024 025 /** 026 * Representation of a datetime field with compact output formatting 027 */ 028 public class DateField extends Field { 029 030 /** Initializes field with default order and given alias. 031 * @param alias The alias of the DateField column. 032 * @see Field#Field(String) 033 */ 034 public DateField(String alias) { 035 super(alias); 036 } 037 038 /** Returns value of the field in current RS2 column. 039 * @return field value 040 * @param rs current resultset 041 * @throws Exception If something went wrong during database operations 042 */ 043 public String getFieldValue(RS2 rs) throws Exception { 044 return SimpleDb.getDateTimeString(rs,getAlias()); 045 } 046 047 }