Bom dia, estou tentando fazer um CRUD no Eclipse e apareceram alguns erros em uns objetos. Eu coloco o cursor logo após o que está sublinhado em vermelho e clico na barra de espaços, mas as mensagens hora são alguma coisa sobre Object ou hora são algo sobre No Default. Como posso corrigir? Será falta de baixar algum driver? Estou só com o JSDK 6.0 e o Eclipse no meu PC. Segue o programa. E as respectivas mensagens que aparecem nos erros, estão em forma de comentários nas linhas exatas:
1 <%@page import="java.sql.ResultSet"%>
2 <%@page import="java.sql.Statement"%>
3 <%@page import="java.sql.DriverManager"%>
4 <%@page import="java.sql.Connection"%>
5 <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
6 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
7 <html>
8 <head>
9 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
10 <title>Insert title here</title>
11 </head>
12 <body>
13 <h1>CRUD JSP</h1>
14 <h3>Usuarios</h3>
15 <table border = "1"><tr>
16 <td>Id</td>
17 <td>nome</td>
18 <td>login</td>
19 <td>senha</td>
20 <td>opcao</td></tr>
21 <% int id;
22 String login;
23 String senha;
24 String action;
25 String url = "jdbc:microsoft:sqlserver//192.168.88.40//1433//SQLHOM20";
26 Class.forName("com.microsoft.sql.server.jdbc.sqlserverdriver").newInstance();
27 Connection conn = DriverManager.getConnection(url, "usrcdc", "usrcdc");
28 Statement stmt = conn.createStatement();
29 ResultSet rs = stmt.executeQuery("SELECT * FROM usuario");
30 while(rs.next()){
31 id = rs.getInt("id");
32 nome = rs.getString("nome"); //nome cannot be resolved to a variable
33 login = rs.getString("login");
34 senha = rs.getString("senha"); %><tr>
35 <td><%=id %></td>
36 <td><%=nome %></td> //Multiple annotations found at this line: - nome cannot be resolved to a variable - Line breakpoint:Retrive.jsp [line: 37]
37 <td><%=login %></td>
38 <td><%=senha %></td>
39 <td><a >id = <%=id %>nome<%=nome %>login<%=login %>senha<%=senha %></a></tr> /* Multiple annotations found at this line:
- nome cannot be resolved to a variable - Line breakpoint:Retrive.jsp [line: 40] */
<% }
40 rs.close();
41 conn.close();
42 %>
43 </table>
44 <a >Novo</a>
45 </body>
46 </html>