You create a
PreparedStatement with an SQL statement that includes
question marks. You can set the value of these parameters then execute the
statement.
PreparedStatement ps = c.prepareStatement("DELETE FROM mega WHERE name=?");
ps.setString(1,"United Kingdom");
ps.execute();
For extra points use addBatch() and executeBatch(). See INSERT a batch for an example.
In this program a temporary table mega is created.
You must write the routine changeMega that adds
a row to the table.
Add the new country 'Neverland' with a population of 10.
Delete the countries that have been condemned.
The String pops includes changes to be made to the table
mega.
You will need to build and execute update statements such as:
UPDATE mega SET population=9200000 WHERE name='Bolivia'
Update the table according to details given.
Also, remove the println statements.