class BoneCP implements Serializable, Closeable {

	protected Connection obtainRawInternalConnection()
	throws SQLException {
		Connection result = null;

		DataSource datasourceBean = this.config.getDatasourceBean();
		String url = this.config.getJdbcUrl();
		String username = this.config.getUsername();
		String password = this.config.getPassword();
		Properties props = this.config.getDriverProperties();
		boolean externalAuth = this.config.isExternalAuth();
		if (externalAuth && 
				props == null){
			props = new Properties();
		}

		if (datasourceBean != null){
			return (username == null ? datasourceBean.getConnection() : datasourceBean.getConnection(username, password));
		}

		// just force the driver to init first
		if (!this.driverInitialized ){
			try{
				this.driverInitialized = true;
				if (props != null){
					result = DriverManager.getConnection(url, props);
				} else {
					result = DriverManager.getConnection(url, username, password);
				}
				result.close();
			}catch (SQLException t){
				// just force the driver to init first
				// See https://bugs.launchpad.net/bonecp/+bug/876476
			}
		}

		if (props != null){
			result = DriverManager.getConnection(url, props);
		} else { 
			result = DriverManager.getConnection(url, username, password);
		}
		// #ifdef JDK>6
		if (this.clientInfo != null){ // we take care of null'ing this in the constructor if jdk < 6
			result.setClientInfo(this.clientInfo);
		}
		// #endif JDK>6

		return result;
	}

	public  BoneCP(BoneCPConfig config);

}