codec - Error is saving java.sql.Date in MongoDB -


not able save java.sql.date field using dbcollection.save()

error : codecconfigurationexception: can't find codec class java.sql.date.

while insert() method has constructor having dbencoder field.

dbcollection.insert(list<? extends dbobject> documents, writeconcern awriteconcern, dbencoder dbencoder) 

but kind of constructor save() method.

you need change date object java.sql.date java.util.date

java.util.date newdate = new date(yoursqldate.gettime()); 

if don't know when did use java.sql.date in code, suggest should try check if there date variable update sql statement.

you should not have problem if use mongo 2.x library, since mongo 3.x library, seems removed java.sql.date support.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -