This text was supposed to be strikethrough to indicate that it needs to
be removed since it's declared outside the outer try scope.
On 03/24/2010 05:40 PM, Jeff Powell wrote:
*Connection* con = DriverManager ...
Should read
con = DriverManager ...
___
Bill,
You're trying to reference the connection out of it's scope.
Try moving the declaration like the example below.
On 03/24/2010 10:49 AM, Brutzman, Bill wrote:
Ben:
1. I am glad to find out about the "finally" command. I was not aware
of this feature in Java.
2. The new code below yield
In Java, variables are local to the block in which they were declared.
So, in order to reach your 'con' variable from outside the 'try' block
it needs to be declared outside of that block.
Connection con = null; // declare con outside of try block.
try{
con = DriverManager...
// do
Ben:
1. I am glad to find out about the "finally" command. I was not aware
of this feature in Java.
2. The new code below yields an IDE error... con cannot be resolved
3. Connection con was already defined... it gives an error when I do a
con = null;
4. IDE does not accept con.close;
5. While I