This is probably an easy one
I´ve got some problems with a few nested try-catch statements. The problem is that the second catch-statement is never reached, even if an exception occurs when I´m trying to use an invalid resource-key.
I need to use the ResourceBundle to form a user-friendly string...
Here is the code:
try
{
// Always throws an exception
resultSet = statement.executeQuery();
}
catch(SQLException e)
{
// Prints the exception allright...
System.out.println(e);
try
{
System.out.println(oSQLResourceBundle.getString(Integer.toString(e.getErrorCode())));
}
catch(MissingResourceException e1)
{
// Does not reach this row
System.out.println(e1);
}
System.out.println(e);
}
Is there anyone out there that´s got an idea about this?
Really appreciate it.
Mol
I´ve got some problems with a few nested try-catch statements. The problem is that the second catch-statement is never reached, even if an exception occurs when I´m trying to use an invalid resource-key.
I need to use the ResourceBundle to form a user-friendly string...
Here is the code:
try
{
// Always throws an exception
resultSet = statement.executeQuery();
}
catch(SQLException e)
{
// Prints the exception allright...
System.out.println(e);
try
{
System.out.println(oSQLResourceBundle.getString(Integer.toString(e.getErrorCode())));
}
catch(MissingResourceException e1)
{
// Does not reach this row
System.out.println(e1);
}
System.out.println(e);
}
Is there anyone out there that´s got an idea about this?
Really appreciate it.
Mol