Discuss / Java / 交作业

交作业

Topic source

THONY_安

#1 Created at ... [Delete] [Delete and Lock User]
StringBuilder sb = new StringBuilder();
		sb.append("INSERT INTO ")
		.append(table)
		.append(" (");
		for(int i = 0;i<fields.length;i++) {
			sb.append(fields[i]);
			if(i!=fields.length-1) {
				sb.append(", ");
			}
		}
		sb.append(") VALUES (?, ?, ?)");
		String s = sb.toString();
		return s;

  • 1

Reply