T
Timo Nentwig
Hi!
Is there any reason why I cannot do this:
try
{
final PreparedStatement st = con.prepareStatement(sql);
..
}
catch..
finally
{
if(st!=null) st.close();
}
??
I have to declare st outside of try and therefore cannot make it final
anymore. Besides I don't understand the sense why finally cannot access
variables inside try.
Can somebody explain?
Regards,
Timo
Is there any reason why I cannot do this:
try
{
final PreparedStatement st = con.prepareStatement(sql);
..
}
catch..
finally
{
if(st!=null) st.close();
}
??
I have to declare st outside of try and therefore cannot make it final
anymore. Besides I don't understand the sense why finally cannot access
variables inside try.
Can somebody explain?
Regards,
Timo