I need to modify a Jlabel of the main page according to the user that has logged in in the Login Frame.
I leave the code that I am working on, in case you can help me. I remain attentive to your answers
void generarNombre() {
String sql = "Select CONCAT(nombre_usuario, ' ', apellido_usuario) As Nombre From usuarios;";
conectar cc = new conectar();
// Connection cn = (Connection) cc.conexion();
try {
java.sql.Statement st = cn.createStatement();
ResultSet rs = st.executeQuery(sql);
while (rs.next()) {
//Aca le digo que muestre el valor en un JtextFiel
lb_usuario_recepcionista.setText(rs.getString("Nombre"));
}
} catch (SQLException e) {
// NOTA: So hubo error muestra el error
JOptionPane.showMessageDialog(null, e);
}
}