As per my comments, you don't need to query the table then update table Shitja line by line. Just do the whole thing at once (MSSQL is
set-based). Try
ResultSet rs = null;
Statement st = null;
String UPDATE_QUERY = "insert into Shitja (TSID,Artikullis,Sasias,cmimis,totals) select TID,Artikullit,Sasiat,cmimit,totalt from T1";
String DELETE_QUERY = "delete from T1";
try {
conn.setAutoCommit(false);
st = conn.createStatement();
pst1 = conn.prepareStatement(UPDATE_QUERY);
pst1.executeUpdate();
st.execute(DELETE_QUERY);
conn.commit();
conn.close();
} catch (Exception e) {
JOptionPane.showMessageDialog(null, e);
}
Caveat: I'm not too familiar with java swing so I may have made minor errors in that code. However I am very familiar with MSSQL and that SQL statement definitely works (assuming that the column names in your original code were correct)