001    package railo.runtime.query.caster;
002    
003    import java.io.IOException;
004    import java.sql.ResultSet;
005    import java.sql.SQLException;
006    import java.sql.Timestamp;
007    
008    import railo.runtime.type.dt.DateTimeImpl;
009    
010    public class TimestampCast 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                    Timestamp ts = rst.getTimestamp(columnIndex);
017                    if(ts==null) return null;
018                    return new DateTimeImpl(ts.getTime(),false);
019            }
020    }