Hello Friends...
I have one urgent query...
Please help me solving it.
I am trying to use PreparedStatementCreator interface.
By making an anonymous inner class,i have implemented it's createPreparedStatement(Connection) method.
When this method is implemented, it will automatically called every time.
But, I want to know which is that connection object being passed to this method?
I am getting a exaception and the error message that is coming is Connection Refused.
Here's the code..
GeneratedKeyHolder generatedKeyHolder = new GeneratedKeyHolder();
insertResult = adapterJdbcTemplate.update(
new PreparedStatementCreator() {
@Override
public PreparedStatement createPreparedStatement(
Connection connection) throws SQLException {
PreparedStatement preparedStatement = connection
.prepareStatement(query);
preparedStatement.setTimestamp(1,
pollingLog.getStartDate());
preparedStatement.setInt(2, pollingLog.getStatus());
return preparedStatement;
}
}, generatedKeyHolder);
Please have a look and suggest me how to solve this issue...
Thanks & Regards,
Sumit Desai