node-jdbc icon indicating copy to clipboard operation
node-jdbc copied to clipboard

PreparedStatement.setDate() leaves column value null

Open juvation opened this issue 7 years ago • 2 comments

does setDate() work? for me it seems to leave the column value null.

for test purposes i'm just using "new Date()" as the value passed in.

juvation avatar Feb 15 '18 20:02 juvation

PreparedStatement.setDate takes a java.sql.Date as the argument, so you have to construct one via newInstance from the node-java library. I'm not sure why it wouldn't error out when you give it new Date()

CraZySacX avatar Feb 15 '18 20:02 CraZySacX

should setDate() convert the Js Date into a java.sql.Date automagically?

juvation avatar Feb 15 '18 21:02 juvation