Its just a foolish queation from a java programmer. I have something like
PreparedStatement stmt = DBConnection.getConnection()
.prepareStatement(sql);
Now in finally block I check if stmt exists and then close it. What will happen to Connection object in this case. I know if I write in separate lines then I can close it as I have a reference to connection object which I don't have in this case.