Example usage for java.sql Timestamp clone

List of usage examples for java.sql Timestamp clone

Introduction

In this page you can find the example usage for java.sql Timestamp clone.

Prototype

public Object clone() 

Source Link

Document

Return a copy of this object.

Usage

From source file:com.db4o.sync4o.SyncData.java

public SyncData(SyncKey key, byte[] data, Timestamp ts, char state) {

    if ((key == null) || (data == null) || !Base64.isArrayByteBase64(data) || (ts == null)) {

        throw new IllegalArgumentException();

    }/*from w  w  w.j a  v  a  2  s .  co m*/

    _key = key;
    _timestamp = (Timestamp) ts.clone();
    _state = state;
    _data = data;

}

From source file:beproject.MainGUI.java

void getTimeLineData(TimeSeriesCollection t) throws SQLException {
    Statement stmt = Initializer.inConn2.createStatement();
    ResultSet rs1 = stmt.executeQuery("select max(ts) from tweets");
    rs1.first();/*from w  ww.j  a v a  2s .  c om*/
    Timestamp ts1 = rs1.getTimestamp(1);
    for (String tmp : ScheduledMoviesList.getMovieNames()) {
        TimeSeries t1 = new TimeSeries(tmp, Hour.class);
        Timestamp ts = (Timestamp) ts1.clone();
        for (int i = 0; i < 6; i++) {
            Date d1 = new java.util.Date(ts.getTime());
            Date d2 = new java.util.Date(ts.getTime() + 3600000);
            ResultSet rs = stmt
                    .executeQuery("select count(*) from tweets where moviename='" + tmp + "' and ts between '"
                            + Regression.sdf.format(d1) + "' and '" + Regression.sdf.format(d2) + "'");
            rs.first();
            //if(!rs.first())
            //  t1.addOrUpdate(new Hour(d1), 0);
            //else
            t1.addOrUpdate(new Hour(d1), rs.getInt(1));
            ts.setTime(ts.getTime() - 3600000);
        }
        t.addSeries(t1);
    }

}

From source file:org.opentaps.rest.ezmorph.TimestampMorpher.java

/**
 * Sets the <code>defaultValue</code>, which is the value set if the input could not be parsed.
 * @param defaultValue a <code>Timestamp</code> value
 *///from  w w  w  .  jav a2  s.com
public void setDefaultValue(Timestamp defaultValue) {
    this.defaultValue = (Timestamp) defaultValue.clone();
}