日期:2014-05-17 浏览次数:21346 次
import org.apache.tomcat.jdbc.pool.DataSource; //import org.springframework.jdbc.datasource.DriverManagerDataSource; import org.springframework.jdbc.core.JdbcTemplate; public class Transaction { private DataSource ds; public DataSource getDs() { return ds; } public void setDs(DataSource ds) { this.ds = ds; } public void insert(String sql){ // System.out.println(sql); JdbcTemplate jt = new JdbcTemplate(ds); jt.execute(sql); } }