SQL Bug - STMT 메세지 중복 날리면 SQL 문법오류 발생 해결 필요

DB
poopki 3 years ago
parent e9298f7be0
commit 7b7bbada94
  1. 11
      DB/DBUpdate.java

@ -30,19 +30,20 @@ public class DBUpdate {
System.out.println("Connection success");
stmt = conn.createStatement();
StringBuilder sb = new StringBuilder();
String sql = sb.append("create table if not exists UserInfo(")
.append("UUID varchar(36)")
/* .append("Nation int,")
/* String sql = sb.append("create table if not exists UserInfo(")
.append("UUID varchar(36),")
.append("Nation int(8)")
.append("Occupation TINYINT,")
.append("Squad int,")
.append("Farm int,")
.append("Account int,")*/
.append("Account int,")
.append(")").toString();
stmt.execute(sql);
*/
for (UUID key : m_InfoArrayInstance.m_UserInfoArray.keySet()) {
//sql = sb.append("insert into UserInfo values('"+key+"',"+0+","+0+","+0+","+0+","+0+")").toString();
sql = sb.append("insert into UserInfo (UUID) value ('"+key.toString()+ "')").toString();
String sql = sb.append("insert into UserInfo values ('test', 0)").toString();
stmt.execute(sql);
}
}

Loading…
Cancel
Save