-
Mar 3rd, 2012, 09:47 AM
#1
How to fix this : org/springframework/dao/DuplicateKeyException
Hi,i am trying to update records in DataBase using spring batch
I have customReader and customWriter classes to read and write to databse
when i run job i am able to read from database but while updating the records
I am getting following exception:
java.lang.NoClassDefFoundError: org/springframework/dao/DuplicateKeyException
My Update method is as follows :
public void update(String col,String val){
System.out.println("IN update method");
ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext("applicationDB.xml" );
DataSource dataSource = (DataSource) appContext.getBean("dataSource");
String sql="update person set fname = ? where fname = ? ";
jdbcTemplate = new JdbcTemplate(dataSource);
jdbcTemplate.update(
sql,
new Object[] {col, val}
);
}
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