I am checking the below condion and displaying dialog box
if(query.contains(tab))
{
JOptionPane.showMessageDialog(null,"Owner does not have privileges to access given table");
}
I want when the dialog box is displayed and condition is true .further execution should stop there itself.How to do this?
and Does JOptionPane degrades application performance? because my application takes lot of time to display dialog box.
Edit:
for(int i=0; i<ia.length; i++)
{
tab= ia[i].toString();
if(query.contains(tab))
{
JOptionPane.showMessageDialog(null,"Owner does not have privileges to access given table");
break;
}
}
//rest code
Based on you comments on @Robin’s answer:
What you can do in your case is: take a flag to decide whether to execute rest of code or not. Some thing like:
I’m not completely sure that I have understood your problem well, but I posted this answer based on what I understood from your above comments and it might also become hard to explain this in comments. Notify me if I’m wrong or have not understood it properly.