|
|
JdbcTemplate not updating the database
Hi,
I am not sure why a JdbcTemplate is not updating the database. Everything is fine:
*) JdbcTemplate is not null
*) int x =jdbcTemplate.update(query, new Object{})...
x value is 1 in debug mode, I have no clue why it is not updating the value..
no erorrs, the test case runs fine.Below is the code snippet:
public class ServiceDAOImpl extends JdbcDaoSupport implements ServiceDAO {
int x =getJdbcTemplate().update(UPDATE_STATUS, new Object[] {Integer.valueOf(Id)});
where UPDATE_STATUS is the string quot;UPDATE PARTY SET AV_ID = 1000 WHERE PK_ID = ? quot;
the frustrating part is in the test case x is 1, and it runs fine but the AV_ID is not 1000 in the database...
no errors nothing...
the test-app-context goes like this..lt;bean id=quot;serviceDAOquot; class=quot;blah.....ServiceDAOImplquot;gt;lt;property name=quot;dataSourcequot;gt;lt;ref local=quot;dataSourcequot; /gt;lt;/propertygt;lt;/beangt;
Use [ code][/code ] tags when posting code...
Use transactions, update/delete/insert without transactions are useless. So configure a transactionmanager and properly configure your tx management. |
|