These statements could be more readable:
String.format("Insert into VarcharTB (id, var2) VALUES(%d, '%s')", 0, var) -->
"insert into VarcharTB (id, var2) VALUES(0, '" + var + "')"