Hi guys. I am trying to use setObject method in preparedstatement to associate an Object with a PreparedStatement.
conn = this.getConnection();
ps = conn.prepareStatement(sql);
ps.setObject(1, new Date());
The problem is that the code above fails with SQLException:
Invalid data conversion: Parameter object type is invalid for requested conversion.
I thought that the setObject will auto-map the object to the relevant data type (in this case java.sql.Date)...