001    package railo.runtime.query.caster;
002    
003    import java.io.IOException;
004    import java.sql.Date;
005    import java.sql.ResultSet;
006    import java.sql.SQLException;
007    
008    import railo.runtime.type.dt.DateTimeImpl;
009    
010    public class DateCast implements Cast{
011    
012            /**
013             * @see railo.runtime.query.caster.Cast#toCFType(int, java.sql.ResultSet, int)
014             */
015            public Object toCFType(int type, ResultSet rst, int columnIndex) throws SQLException, IOException {
016                    Date d = rst.getDate(columnIndex);
017                    if(d==null) return null; 
018                    
019                    return new DateTimeImpl(d.getTime(),false);
020                    
021            }
022    
023    }