Announcement Announcement Module
Collapse
No announcement yet.
JdbcTemplate not updating the database Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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>

  • #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.

    Comment

    Working...
    X