adejanovski / cassandra-jdbc-wrapper

A JDBC wrapper for the Datastax Java Driver for Cassandra
Apache License 2.0
53 stars 36 forks source link

Add possibility to set/get Timestamp fields as Long in queries #4

Closed amedvedchuk closed 8 years ago

amedvedchuk commented 8 years ago

This feature allows to set/get timestamp column in table using simple Long value. It can be useful when you have not direct control over queries and result interpretation as if you using driver in frameworks like WSO2.

Now you can use both variants in setting: pstatement.setObject(11, new Timestamp(now.getTime())); pstatement.setObject(11, now.getTime());

and getting of timestamps: Long res1 = resultSet.getLong("timestamp_col1"); Timestamp res2 = resultSet.getTimestamp("timestamp_col2");

https://datastax.github.io/java-driver/manual/custom_codecs/

adejanovski commented 8 years ago

Merged, thanks !