From d110918f9e7eaff3ddac88585c2e85ad8533a9ea Mon Sep 17 00:00:00 2001 From: poopki Date: Mon, 11 Jul 2022 23:19:15 +0900 Subject: [PATCH] =?UTF-8?q?UserInfo=20=EC=A4=91=EB=B3=B5=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20=ED=95=B4=EA=B2=B0=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DB/DBUpdate.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DB/DBUpdate.java b/DB/DBUpdate.java index 2d23717..92cfd0b 100644 --- a/DB/DBUpdate.java +++ b/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 ){