jdbc事务 数据源
事务: 为什么要开启事务,在程序中并不是编译过了就行了,逻辑行的同才行。 有了事务可以更好的帮我们执行逻辑 数据源: 数据库连接优化 帮我们更快的链接数据库 数据源有个数据库池用的话直接从数据库池中拿就行 import com.mchange.v2.c3p0.ComboPooledDataSource; import javax.sql.DataSource; import java.beans.PropertyVetoException; import java.sql.Connection; import java.sql.SQLException; public class T1 { /** * 常见connection对象 */ private static T1 ourInstance = new T1(); private DataSource dataSource = null;//申请一个数据源 接口为空 public static T1 getInstance() { return ourInstance; } private T1() {//因为这里是构...