public Funcionario selectById(long id){
		Funcionario funcionario = new Funcionario(null);
		try {
			connection = Conexao.getInstance().obterConexao();
			connection.setAutoCommit(false);
			statement = connection.createStatement();
	 
			resultSet = statement.executeQuery("SELECT * FROM TB_FUNCIONARIO WHERE ID = " + id);
			resultSet.next();
			funcionario.setId(resultSet.getLong("id"));
			funcionario.setEndereco(endDAO.selectById(resultSet.getLong("id_endereco")));
			funcionario.setPapel(papelDAO.selectById(resultSet.getLong("id_papel")));
			funcionario.setNome(resultSet.getString("nome"));
			funcionario.setEmail(resultSet.getString("email"));
			funcionario.setTelefone(resultSet.getString("telefone"));
			funcionario.setDataNascimento(resultSet.getDate("data_nasc"));
			funcionario.setCodigo(resultSet.getString("codigo"));
			funcionario.setContaCorrente(resultSet.getString("conta_corrente"));
	 
		} catch (Exception e) {
			// TODO: handle exception
			try {
				if (connection != null && !connection.isClosed()) {
					connection.rollback();
				}
			} catch (SQLException e2) {
				// TODO: handle exception
				e2.printStackTrace();
			} finally{
				try {
					if (resultSet != null) {
						resultSet.close();
					}
					if (statement != null) {
						statement.close();
					}
					if (connection != null) {
						connection.close();
					}
				} catch (Exception e3) {
					// TODO: handle exception
				}
			}
		}
	 
		
		return funcionario;
	 
	}