What exactly would an SQL query be according to the following method?
The problem is that with the three tables I can not get it out correctly. The only thing that would have to be modified would be the consultation.
-show OrderData (int OrderNumber) . This method will consult the database and show the last order as a parameter, the products that it includes (code and name) and the quantity requested of each of them.
Code:
public static void mostrarDatosPedido(int numeroPedido)
throws ClassNotFoundException, SQLException {
ConectarSingleton conexion = new ConectarSingleton();
Connection con = conexion.getConexion(); //añadir excep.
ResultSet rs = GestionClassic.consultar("select * from pedidos where numeroPedido='"+numeroPedido+"'");
while(rs.next()) {
System.out.println(rs.getInt(1)+"\t"+rs.getDate(2)+"\t"+rs.getDate(3)+"\t"
+rs.getDate(4)+"\t"+rs.getString(5)+"\t"+rs.getString(6)+"\t"+rs.getInt(7)+"\t");
}
}