I am using jdbc and I am storing SQL Queries in a interface or class and having all of them as public static and final. Say:
public static final QUERY_1="insert into table1 (c11,c12) values (?,?)";
public static final QUERY_1="insert into table2 (c21,c22) values (?,?)";
observing above two string i thought that insert ,into ,(,), values all these things appear in both the statements.so instead of having them in both the string I will have them as constants and create queries by String manipulation on runtime but I am worried whether I will hamper the performance.
What is the suggested approach ?