-
Sep 22nd, 2010, 11:10 PM
#1
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 "UPDATE PARTY SET AV_ID = 1000 WHERE PK_ID = ? "
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..
<bean id="serviceDAO" class="blah.....ServiceDAOImpl">
<property name="dataSource"><ref local="dataSource" /></property>
</bean>
-
Sep 23rd, 2010, 01:20 AM
#2
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules