2
This is an excerpt from a JSP page that lists the log-in user’s commitments.I don’t use JSP nor do I usually select this type but I need to use it this 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>
Giving error in + user + from select * from compromise. I don’t know what could be wrong.
Which error is displayed?
– Marcelo de Andrade
Escape the simple quotes with \
– user28595
The error is : "Cannot find Symbol variable user"
– Tiago Frioli