I have a function that writes a sql query
I can't figure out what does the expression %s(%s) do in this function
public void createTable(String tabName) throws SQLException {
String sql = "create table if not exists %s(%s)";
sql = String.format(sql,
tabName,
String.format("%s,%s,%s,%s,%s,%s,%s",
"id int primary key auto_increment",
"surname varchar(50)",
"name varchar(50)",
"age int(3)",
"course int(1)",
"group varchar(50)",
"stateFunded int(1)"
));
stat.execute(sql);
System.out.println(sql);
}
I've tried to search, but there is no information about it in Google.