@ SuppressWarnings ( "resource" ) protected DatabaseConnection makeConnection ( Logger logger ) throws SQLException { Properties properties = new Properties ( ) ; if ( username != null ) { properties . setProperty ( "user" , username ) ; } if ( password != null ) { properties . setProperty ( "password" , password ) ; } DatabaseConnection connection = new JdbcDatabaseConnection ( DriverManager . getConnection ( url , properties ) ) ; // by default auto-commit is set to true connection . setAutoCommit ( true ) ; if ( connectionProxyFactory != null ) { connection = connectionProxyFactory . createProxy ( connection ) ; } logger . debug ( "opened connection to {} got #{}" , url , connection . hashCode ( ) ) ; return connection ; }
Make a connection to the database .