From 1b2ed8bec4aaf3706c65c28993c5c306a5b1284b Mon Sep 17 00:00:00 2001 From: graywolf336 Date: Thu, 20 Feb 2014 21:07:06 -0600 Subject: [PATCH] We'll use replace into and not insert into, #18. --- src/main/java/com/graywolf336/jail/JailIO.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/graywolf336/jail/JailIO.java b/src/main/java/com/graywolf336/jail/JailIO.java index 9ae80a1..545b32f 100644 --- a/src/main/java/com/graywolf336/jail/JailIO.java +++ b/src/main/java/com/graywolf336/jail/JailIO.java @@ -416,7 +416,7 @@ public class JailIO { cPS.close(); Prisoner p = c.getPrisoner(); - PreparedStatement pPS = con.prepareStatement("INSERT INTO `" + prefix + "prisoners` (`name`, `jail`, `cell`, `muted`, `time`," + PreparedStatement pPS = con.prepareStatement("REPLACE INTO `" + prefix + "prisoners` (`name`, `jail`, `cell`, `muted`, `time`," + "`offlinePending`, `toBeTransferred`, `jailer`, `reason`, `inventory`, `armor`, `previousLocation`, `previousGameMode`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)"); pPS.setString(1, p.getName()); pPS.setString(2, j.getName()); @@ -446,7 +446,7 @@ public class JailIO { if(con == null) this.prepareStorage(false); for(Prisoner p : j.getPrisonersNotInCells()) { - PreparedStatement pPS = con.prepareStatement("INSERT INTO `" + prefix + "prisoners` (`name`, `jail`, `cell`, `muted`, `time`," + PreparedStatement pPS = con.prepareStatement("REPLACE INTO `" + prefix + "prisoners` (`name`, `jail`, `cell`, `muted`, `time`," + "`offlinePending`, `toBeTransferred`, `jailer`, `reason`, `inventory`, `armor`, `previousLocation`, `previousGameMode`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)"); pPS.setString(1, p.getName()); pPS.setString(2, j.getName());