UserInfo 중복 생성 해결 완료

DB
poopki 3 years ago
parent a672c71a91
commit d110918f9e
  1. 8
      DB/DBUpdate.java

@ -32,7 +32,7 @@ public class DBUpdate {
stmt = conn.createStatement();
StringBuilder sb = new StringBuilder();
String sql = sb.append("create table if not exists UserInfo(")
.append("UUID varchar(36),")
.append("UUID varchar(36) PRIMARY KEY,")
.append("Nation int(8),") //public
.append("Squad int(8),") //public
.append("Farm int(8)") //public
@ -103,13 +103,13 @@ public class DBUpdate {
//sql = sb.append("insert into UserInfo values('"+key+"',"+0+","+0+","+0+","+0+","+0+")").toString();
//String sql = sb.append("insert into UserInfo values ('test', 0)").toString();
//stmt.execute(sql);
String sql = "INSERT INTO UserInfo VALUES (?,?,?,?)";
String sql = "REPLACE INTO UserInfo VALUES (?,?,?,?)";
pstmt = conn.prepareStatement(sql);
//pstmt.setString(1, key.toString());
pstmt.setString(1, String.valueOf(m_InfoArrayInstance.m_UserInfoArray.get(key).getUserUUID()));
pstmt.setString(2, String.valueOf(11));
pstmt.setString(3, String.valueOf(12));
pstmt.setString(4, String.valueOf(33));
pstmt.setString(3, String.valueOf(23));
pstmt.setString(4, String.valueOf(56));
int cnt = pstmt.executeUpdate();
if( cnt == 0 ){

Loading…
Cancel
Save