1 33 package net.myvietnam.mvncore.db; 34 35 import java.sql.Connection ; 36 import java.sql.SQLException ; 37 38 42 public class MVNDataSource extends AbstractDataSource { 43 44 private boolean autoCommit; 45 46 public MVNDataSource(boolean autoCommit) { 47 this.autoCommit = autoCommit; 48 } 49 50 public Connection getConnection() throws SQLException { 51 Connection connection = DBUtils.getConnection(); 52 if (connection.getAutoCommit() != autoCommit) { 53 connection.setAutoCommit(autoCommit); 54 } 55 return connection; 56 } 57 58 public Connection getConnection(String username, String password) throws SQLException { 59 throw new UnsupportedOperationException ("getConnection"); 60 } 61 62 } 63 | Popular Tags |