I would like a help, I made a connection with the Oracle database and on this call I will consult the bank data by the name ...
the result , it's okay.
Only I want to skirt formatted inside a table as if it were a spreadsheet ..
and I do not get the code to get a table, I have the answer I want no longer formatted on a table.
The code I use is this:
<%@ page import="java.sql.*" %>
<%
String nome=request.getParameter("nome");
int flag=0;
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:XE","system","nino");
PreparedStatement stmt = con.prepareStatement("select * from aluno where nome=?");
stmt.setString(1,nome);
ResultSet rs = stmt.executeQuery();
while(rs.next()){
out.print("<br>" + rs.getInt("cod"));
out.print("<br>" + rs.getString("nome") + rs.getString("endereco"));
out.print("<br>" + rs.getString("endereco"));
out.print("<br>" + rs.getString("tel"));
flag=1;
}
if (flag==1){
out.print("<p>Nome Encontrado");
}else{
out.print("<p>Nome não Encontrado");
}
}
catch(Exception e){
}
%>
<br><a href="index.jsp">Voltar</a>