@Override
	public Connection getConnection() {
		if (username == null) {
			try {
				InitialContext initialContext = new InitialContext();
				DataSource dataSource = (DataSource) initialContext
						.lookup(jndi);
				return dataSource.getConnection();
			} catch (NamingException e) {
				throw new DbKingException(e);
			} catch (SQLException e) {
				throw new DbKingException(e);
			}
		} else {
			try {
				InitialContext initialContext = new InitialContext();
				DataSource dataSource = (DataSource) initialContext
						.lookup(jndi);
				return dataSource.getConnection(username, password);
			} catch (NamingException e) {
				throw new DbKingException(e);
			} catch (SQLException e) {
				throw new DbKingException(e);
			}
		}
	}