Q: Wrong sql syntax to get data from other table I'm having, trouble getting data from some other table.
I'm using Java preparedStatements and mySQL.
This is my sql query: 
String sql = "SELECT alumno.nombre, alumno.apellido, curso.nombre, aula.numero FROM "+
                "((alumno INNER JOIN curso ON alumno.id_curso = curso.id_curso) "+
                "INNER JOIN aula ON alumno.id_aula = aula.id_aula) "+
                "WHERE (alumno.nombre=? "+
                "OR alumno.apellido=?) "+
                "OR curso.nombre=? "+
                "OR aula.numero=?;";

I'm getting this error: Error :Column 'curso' not found.. Why is it trying to get a column when I'm using the dot(.) notation to access the curso table. I'm new to Java-mySQL.
This is my java code:
try{
       conn = Conexion.connect();
       stm = conn.prepareStatement(sql);
       stm.setString(1, "Diego");
       stm.setString(2, "Rios");
       stm.setString(3, "Informatica");
       stm.setString(4, "202");
       rs = stm.executeQuery();
       System.out.println(stm);
       while(rs.next()){
           String nombre =  rs.getString("nombre");
           String apellido =  rs.getString("apellido");
           String curso =  rs.getString("curso");
           String aula =  rs.getString("aula");

           System.out.println(nombre);
           System.out.println(apellido);
           System.out.println(curso);
           System.out.println(aula);

           a.setNombre(nombre);
           a.setApellido(apellido);
           a.setCurso(curso);
           a.setAula(aula);

           lista.add(a);
       }
    } catch (Exception e){
        System.out.println("Error :"+e.getMessage());
    } finally {
        if(stm != null){
            try {
                stm.close();
            } catch (SQLException ex) {
                Logger.getLogger(AlumnoDAO.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        if(conn != null){
            try {
                conn.close();
            } catch (SQLException ex) {
                Logger.getLogger(AlumnoDAO.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }

PS: It is working in mySQL-workbench.
Thank you!

A: I would recommend writing the query as:
SELECT a.nombre, a.apellido, c.nombre, au.numero
FROM alumno a INNER JOIN
     curso c
     ON a.id_curso = c.id_curso INNER JOIN
     aula au
     ON a.id_aula = au.id_aula
WHERE a.nombre = ? OR
      a.apellido = ? OR
      c.nombre = ? OR
      au.numero = ?

However, I don't see how the use of aliases, removing the parentheses, or removing the semicolon could result in the error you see.  One possibility would be an invalid character in the SELECT or WHERE clauses, one that is not visible.
EDIT:
I think your problem is this code:
String curso =  rs.getString("curso");

There is no output column called curso.  This can be fixed in the select:
SELECT a.nombre, a.apellido, c.nombre as curso_nombre, au.numero

Then use:
String curso =  rs.getString("curso_nombre");


A: the culprit is here,
       String curso =  rs.getString("curso"); // You should retrieve here a column and not a table.
       String aula =  rs.getString("aula");

Thats why you get an error Error :Column 'curso' not found..
you should put the column you write on your query like:
String curso =  rs.getString("curso.nombre");
String aula =  rs.getString("aula.numero");

