Erro ao carregar imagem do banco

0 respostas
akiles

Ola pessoal estou com o seguinte problema preciso recuperar algumas imagens que esta no banco de dados.
porém não sei com fazer, algum pode me ajudar.

segue minhas classes.
Minha jsp.

</tr>
  
 <%
		TarefaDAO dao = new TarefaDAO();
		List<Tarefa> contatos = dao.getlista();

		for (Tarefa contato : contatos) {
	%>
	<tr>
		
		&lt;td width="197"&gt;<a ><img > alt=&quot;&quot; width=&quot;252&quot; height=&quot;158&quot;&gt;</a>&lt;/td&gt;
		&lt;td width="197"&gt;<a ><img > alt=&quot;&quot; width=&quot;252&quot; height=&quot;158&quot;&gt;&lt;/td&gt;
		
		
	&lt;/tr&gt;
	&lt;%
		}
	%&gt;
Minha dao.
public List&lt;Tarefa&gt; getlista() throws IOException {
		try {
			List&lt;Tarefa&gt; cartoes = new ArrayList&lt;Tarefa&gt;();
			PreparedStatement stmt = this.connection.prepareStatement("SELECT * FROM dadoscartoes");
			ResultSet rs = stmt.executeQuery();

			while (rs.next()){
				Tarefa cartao = new Tarefa();
				
				cartao.setId(rs.getLong("id"));
				cartao.setNome(rs.getString("nome"));
				cartao.setEmpresa(rs.getString("empresa"));
				cartao.setTelefone(rs.getString("telefone"));
				cartao.setEmail(rs.getString("email"));
				
				byte[] buffer = rs.getBytes("pesquisa");
				byte[] buffer2 = rs.getBytes("pesquisa2");
				
				cartao.setDescricao(rs.getString("descricao"));

				cartoes.add(cartao);
			}
			rs.close();
			stmt.close();
			return cartoes;
		} catch (SQLException e) {
			throw new RuntimeException(e);
		}

	}

Criado 14 de agosto de 2012
Respostas 0
Participantes 1