Hi. I need help with displaying my resultSet values in ONLY ONE JOptionPane.INFORMATION_MESSAGE.
Here's my code so far ( extracted from my whole program ):
else if ( rb4.isSelected() )
{
resultSet = statement.executeQuery( "select * from agents" );
while ( resultSet.next() )
{
JOptionPane.showMessageDialog( this, resultSet.getString(1) + resultSet.getString(2)
, "List All Agents", JOptionPane.INFORMATION_MESSAGE);
}
}
What happens at the moment is with EVERY single row in mySQL database table, it displays one JOption pop-up.
So if I have 4 rows in my table agents, there's four message pop-ups.
I want it to diplay the WHOLE table in ONE message pane.
Can anyone PLEAAAASEEE help me?
I'm at my wits end. Almost everything works fine, except for that.
I mean, I can connect to my database, and call everything and stuff like that.
Thank you so much!