java - Cannot obtain value of timestamp -
i having problems obtaining column sql server.
the db has column of type timestamp
, , trying set value in java, following message error message:
com.microsoft.sqlserver.jdbc.sqlserverexception:the conversion type timestamp timestamp not compatible.
my java code :
dtooperacion.setextractiondate(rs.gettimestamp(7));
the property extractiondate
type java.sql.timestamp
.
is there type specified jdbc sql server can use this?
i think using wrong datatype in table in first place. should using datetime instead of timestamp data type. per sql server documentation timestamp is-
"is data type exposes automatically generated, unique binary numbers within database. timestamp used mechanism version-stamping table rows. storage size 8 bytes. timestamp data type incrementing number , not preserve date or time. record date or time, use datetime data type."
Comments
Post a Comment