Estou fazendo um projetinho em jsp…
<%
Connection con=null;
Statement stmt = null;
ResultSet rs=null;
String query="", url=“jdbc:mysql://localhost/controlepedidos”;
try {
Class.forName("com.mysql.jdbc.Driver"); //carregamos o driver do Connector-J
con = DriverManager.getConnection(url,"root", "frifro"); //estabelecemos a conexão
// e criamos o objeto para depois executar comandos SQL:
stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, //podemos ver as mudanças efetuadas
ResultSet.CONCUR_UPDATABLE);
query = "INSERT INTO cliente (Nome, Telefone, Estado) VALUES ('"+txNome.getText()+"','"+txTelefone.getText()+"','"+txEstado.getText()+"')";
rs = stmt.executeQuery(query); //agora criamos o conjunto de resgistros
String nome; String telefone; String estado;
while (rs.next()){
nome = rs.getString("Nome");
telefone = rs.getString("Telefone");
estado = rs.getString("Estado");
out.println("<p>" + nome + ", Telefone: " + telefone + ", Estado:" + estado + "</p>" );
}
}
catch(ClassNotFoundException ex){
out.println("Erro carregando o driver do banco de dados -> " + ex.getMessage());
}
catch(SQLException ex){
out.println("Erro em comandos SQL -> " + ex.getMessage());
}
finally{
if(rs!=null){rs.close(); rs=null;}
if(stmt!=null){stmt.close(); stmt=null;}
if(con!=null){con.close(); con=null;}
}
%>
erro:
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
library-inclusion-in-archive:
library-inclusion-in-manifest:
compile:
compile-jsps:
Compiling 1 source file to C:\Documents and Settings\Thiago Passos\Desktop\TrabalhoInter\build\generated\classes
C:\Documents and Settings\Thiago Passos\Desktop\TrabalhoInter\build\generated\src\org\apache\jsp\CadastroCliente_jsp.java:93: cannot find symbol
symbol : variable txNome
location: class org.apache.jsp.CadastroCliente_jsp
query = “INSERT INTO cliente (Nome, Telefone, Estado) VALUES (’”+txNome.getText()+"’,’"+txTelefone.getText()+"’,’"+txEstado.getText()+"’)";
^
C:\Documents and Settings\Thiago Passos\Desktop\TrabalhoInter\build\generated\src\org\apache\jsp\CadastroCliente_jsp.java:93: cannot find symbol
symbol : variable txTelefone
location: class org.apache.jsp.CadastroCliente_jsp
query = “INSERT INTO cliente (Nome, Telefone, Estado) VALUES (’”+txNome.getText()+"’,’"+txTelefone.getText()+"’,’"+txEstado.getText()+"’)";
^
C:\Documents and Settings\Thiago Passos\Desktop\TrabalhoInter\build\generated\src\org\apache\jsp\CadastroCliente_jsp.java:93: cannot find symbol
symbol : variable txEstado
location: class org.apache.jsp.CadastroCliente_jsp
query = “INSERT INTO cliente (Nome, Telefone, Estado) VALUES (’”+txNome.getText()+"’,’"+txTelefone.getText()+"’,’"+txEstado.getText()+"’)";
^
3 errors
C:\Documents and Settings\Thiago Passos\Desktop\TrabalhoInter\nbproject\build-impl.xml:353: The following error occurred while executing this line:
C:\Documents and Settings\Thiago Passos\Desktop\TrabalhoInter\nbproject\build-impl.xml:141: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 1 second)
alguem podeirma me ajudar