Class.forName("com.mysql.jdbc.Driver");
ct=DriverManager.getConnection("jdbc:mysql://localhost:3306/test1","root","wenhao");
sm=ct.createStatement();
rs=sm.executeQuery("select *from test");
try {
ps=ct.prepareStatement("insert test values(14,'aaa')");
System.out.print("插入成功");
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.print("插入失败");
}
INSERT 事务没有提交。