You should use the close() method in the Statement object when you do not need it anymore.

You should also use the close() method in the Connection object when you do not need it anymore.

You can download this example here(needed tools can be found in the right menu on this page).

If we run this application the result should be:

As pure output

Translated by a Browser

New price for all cars are calculated
<table border='1' ><tr><td>AD23443</td><td>BMW</td><td>2001</td><td>300.0</td><td>240.0</td></tr><tr><td>AX72345</td><td>AUDI</td><td>2003</td><td>350.0</td><td>280.0</td></tr><tr><td>CE23473</td><td>AUDI</td><td>2001</td><td>400.0</td><td>320.0</td></tr><tr><td>DE12345</td><td>AUDI</td><td>2003</td><td>250.0</td><td>200.0</td></tr><tr><td>DE23453</td><td>FORD</td><td>2002</td><td>375.0</td><td>300.0</td></tr><tr><td>DE34562</td><td>OPEL</td><td>2001</td><td>340.0</td><td>272.0</td></tr><tr><td>RE23456</td><td>FORD</td><td>2005</td><td>350.0</td><td>280.0</td></tr><tr><td>XY34567</td><td>BMW</td><td>2009</td><td>347.0</td><td>278.0</td></tr></table>