Checkbox

Senhores,

    Sou muito novo nessa área de desenvolvimento. Está tudo Funcionando no meu sisteminha. Sei que tem alguns detalhes que não deveria fazer. Por exemplo colocar no JSP senha de banco, etc.

    Assim, o que de fato preciso, é receber alguns dados do banco através do ChecKbox para calcular. A tela que está em anexo, mostra que já busca do banco as informações que preciso, mas preciso ainda selecionar qula informação preciso. Vejam:

<%@ page contentType="text/html" language="java" import="java.sql.*"%>   
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><head>
<style type="text/css">
@import "/Projetos/template_css.css";
</style>
<title>Consulta de Investidores</title>
   
   
  
<form name="form1" method="post" action="CalMont">
  <p>&nbsp;</p>
  <p><strong>Selecione o Investimento a ser Calculado:</strong></p>
  <p>
    <script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
  </p>
  <link href="file:///D|/Faculdade/workspace/Projetos/123.css" rel="stylesheet" type="text/css">
</head>   
  
<body>
<%   
    Connection con;   
    Statement stm;   
    String URL = "jdbc:mysql://localhost/tec3";
    String USER = "root";
	String SENHA = "root";
	String driver = "org.gjt.mm.mysql.Driver";
	
   try {   
  
      Class.forName(driver);   
      con = DriverManager.getConnection(URL,USER,SENHA);   
      stm = con.createStatement(); 
      ResultSet res = stm.executeQuery("SELECT i.descricao,
 i.tipoapl_codtipo, x.juro, i.valor, i.tempo, i.investidor_cpf, j.nome, 
i.instituicao_cnpj, k.nome from investimento i inner join tipoapl x on 
x.codtipo=i.tipoapl_codtipo inner join investidor j on j.cpf=i.investidor_cpf 
inner join instituicao k on k.cnpj=i.instituicao_cnpj;");
      { 
%> 

<table width="1035" border="1">
  <tr> 
    <td width="116"><div align="center"><strong>CPF Investidor</strong></div></td>
    <td width="189"><div align="center"><strong>Nome</strong></div></td>
    <td width="264"><div align="center"><strong>Descrição</strong></div></td>
	<td width="229"><div align="center"><strong>Instituição</strong></div></td>
    <td width="93"><div align="center"><strong>Valor</strong></div></td>
    <td width="49"><div align="center"><strong>Tempo</strong></div></td>
	<td width="73"><div align="center"><strong>Selecionar</strong></div></td>
  </tr>
  <%while(res.next()){%>
  <tr> 
    <td><%=res.getString("i.investidor_cpf")%></td>
    <td><%=res.getString("j.nome")%></td>
	<td><%=res.getString("i.descricao")%> </td>
    <td><%=res.getString("k.nome")%></td>
	<td><%=res.getString("i.valor")%> </td>
	<td><%=res.getString("i.tempo")%></td>
	<td><div align="center">
          <input name="checkbox" type="checkbox" value="sel">
      </div></td>
    <%}%>
  </tr>
</table>

  <% 
} 

        
            
   } catch (Exception e) {   
      out.println( e.getMessage());   
   }   
%>
  <p align="center"> 
    <input type="submit" name="Submit" value="Calcular">
  </p>

</form>
<p>&nbsp;</p>

</body>   


acho que oq vc precisa é de um pouco de …

vou dar uma pesquisada, e posto aqui dps.

Provavelmente virão com outras soluções melhores que a minha heheh

É verdade já me falaram isso… Sabe onde tem material para estudo?

grato

Fabiano

Encontrei uma cópia para consulta, durante uma breve consulta no google, do livro Ajax in action.

http://austin.youareinferior.net/books/AJAX%20In%20Action.pdf

O livro em português para compra… em média custa 99 mangos.

Tem algumas lojas que vendem, deve ter outras, mas aqui vai alguns links:

http://www.linuxmall.com.br/index.php?product_id=4048
http://www.siciliano.com.br/livro.asp?orn=HSE&Tipo=2&ID=989818