JDBC Connection

In one of the method I am performing the following operations: Quering a table and storing the values in varibales, befrore inserting I am truncating the table and then inserting the values into the table.