I want to move all data that last 7 days before current date to other database, therefore i'm using two connection to select and insert the data. The problem is I can't insert datetime type into the table, it appears as 0000-00-00 00:00:00 when I checked it. I tried to parse using SimpleDateFormat but still not working. This is the snippet
Sometimes it's hard to guess the cause of problem. Can you possibly include the stack trace of the exception you've got? That way, we'll easily pin point where the problem is coming from, hence possible solution can be provided.
But initially, you might not be getting any results at all in your ResultSet object. Besides, you can simply use Statement, rather than PreparedStatement because you're not using or setting any parameters to your query anyway.