package com.xdmz.business.publicservice.applyonline.product.action;
import java.util.Date;
import javax.faces.application.Application;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jdbc.core.JdbcTemplate;
public class TEST {
public static void main(String[] args) {
ApplicationContext apc = new ClassPathXmlApplicationContext("spring.xml");
JdbcTemplate jdbc = apc.getBean(JdbcTemplate.class);
String sql = "update t_business_072_broker set creatime=?";
Object o = new Date();
int i = jdbc.update(sql , o);
System.out.println(i);
}
}
本文介绍了一个使用Spring框架整合JDBC进行数据库更新操作的示例代码。该示例通过Spring的依赖注入功能获取JDBC模板,并利用其执行SQL更新语句,实现了对数据库表中记录的创建时间字段进行更新。
2157

被折叠的 条评论
为什么被折叠?



