Discuss / Java / 倒是没看到有人这样

倒是没看到有人这样

Topic source

Joker.fu_95

#1 Created at ... [Delete] [Delete and Lock User]
String ss = "INSERT INTO %s (%s, %s, %s) VALUES (?, ?, ?)";return String.format(ss, table, fields[0], fields[1], fields[2]);

Joker.fu_95

#2 Created at ... [Delete] [Delete and Lock User]
"INSERT INTO " + table + " (" + fields[0] + ", " + fields[1] + ", " + fields[2] + ") VALUES (?, ?, ?)"

Joker.fu_95

#3 Created at ... [Delete] [Delete and Lock User]

如果大量拼接StringBuilder性能肯定更好


  • 1

Reply