This is an excerpt from a JSP page that lists logged-in user commitments. I do not use JSP nor do I usually do this kind of select but I need to use it that way.
<%
try {
Class.forName("com.mysql.jdbc.Driver");
Connection conn
= DriverManager.getConnection("jdbc:mysql://localhost/agendaLogin", "root", "root");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM compromisso where usuario = '" + usuario + "'");
%>
<table width="100%" border="1" class="centralizarDireita">
<tr>
<td><b>Titulo</b></td>
<td><b>Tipo</b></td>
<td><b>Data</b></td>
<td><b>Local</b></td>
<td><b>Observacao</b></td>
</tr>
This is giving an error in + user + from the select * from appointment. I do not know what could be wrong.