Connection getConnection ( ) throws ClassNotFoundException , SQLException { Class . forName ( job . get ( DBConfiguration . DRIVER_CLASS_PROPERTY ) ) ; if ( job . get ( DBConfiguration . USERNAME_PROPERTY ) == null ) { return DriverManager . getConnection ( job . get ( DBConfiguration . URL_PROPERTY ) ) ; } else { return DriverManager . getConnection ( job . get ( DBConfiguration . URL_PROPERTY ) , job . get ( DBConfiguration . USERNAME_PROPERTY ) , job . get ( DBConfiguration . PASSWORD_PROPERTY ) ) ; } }
Returns a connection object o the DB