Package railo.runtime.query.caster

Source Code of railo.runtime.query.caster.TimestampCast

package railo.runtime.query.caster;

import java.io.IOException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.TimeZone;

import railo.commons.date.JREDateTimeUtil;
import railo.runtime.type.dt.DateTimeImpl;

public class TimestampCast implements Cast{

  @Override
  public Object toCFType(TimeZone tz,int type, ResultSet rst, int columnIndex) throws SQLException, IOException {
    Timestamp ts = rst.getTimestamp(columnIndex,JREDateTimeUtil.getThreadCalendar(tz));
    if(ts==null) return null;
    return new DateTimeImpl(ts.getTime(),false);
  }
}
TOP

Related Classes of railo.runtime.query.caster.TimestampCast

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.