Removed unused imports

This commit is contained in:
Robin Kupper
2011-03-28 20:02:16 +02:00
parent 8cc05467f7
commit 8007e40e27
5 changed files with 6 additions and 10 deletions

View File

@ -4,7 +4,6 @@ import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.logging.Level;
@ -38,7 +37,7 @@ public class AreaBlockSearch implements Runnable
SimpleDateFormat formatter = new SimpleDateFormat("MM-dd HH:mm:ss");
try {
conn.setAutoCommit(false);
ps = conn.prepareStatement("SELECT * FROM `" + table + "` INNER JOIN `lb-players` USING (`playerid`) WHERE (type = ? or replaced = ?) and y > ? and y < ? and x > ? and x < ? and z > ? and z < ? order by date desc limit 10", Statement.RETURN_GENERATED_KEYS);
ps = conn.prepareStatement("SELECT * FROM `" + table + "` INNER JOIN `lb-players` USING (`playerid`) WHERE (type = ? or replaced = ?) and y > ? and y < ? and x > ? and x < ? and z > ? and z < ? order by date desc limit 10");
ps.setInt(1, type);
ps.setInt(2, type);
ps.setInt(3, location.getBlockY() - size);

View File

@ -4,7 +4,6 @@ import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import org.bukkit.ChatColor;

View File

@ -4,7 +4,6 @@ import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.logging.Level;
@ -43,7 +42,7 @@ public class BlockStats implements Runnable
SimpleDateFormat formatter = new SimpleDateFormat("MM-dd HH:mm:ss");
try {
conn.setAutoCommit(false);
ps = conn.prepareStatement("SELECT * FROM `" + table + "` LEFT JOIN `" + table + "-sign` USING (`id`) INNER JOIN `lb-players` USING (`playerid`) WHERE `x` = ? AND `y` = ? AND `z` = ? ORDER BY `date` DESC LIMIT 15", Statement.RETURN_GENERATED_KEYS);
ps = conn.prepareStatement("SELECT * FROM `" + table + "` LEFT JOIN `" + table + "-sign` USING (`id`) INNER JOIN `lb-players` USING (`playerid`) WHERE `x` = ? AND `y` = ? AND `z` = ? ORDER BY `date` DESC LIMIT 15");
ps.setInt(1, block.getX());
ps.setInt(2, block.getY());
ps.setInt(3, block.getZ());

View File

@ -4,7 +4,6 @@ import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import org.bukkit.ChatColor;
@ -32,7 +31,7 @@ public class PlayerAreaStats implements Runnable
ResultSet rs = null;
try {
conn.setAutoCommit(false);
ps = conn.prepareStatement("SELECT `type`, SUM(`created`) AS `created`, SUM(`destroyed`) AS `destroyed` FROM ((SELECT `type`, count(`type`) AS `created`, 0 AS `destroyed` FROM `" + table + "` INNER JOIN `lb-players` USING (`playerid`) WHERE `playername` = ? AND x > ? AND x < ? AND z > ? AND z < ? AND `type` > 0 AND `type` != `replaced` GROUP BY `type`) UNION (SELECT `replaced` AS `type`, 0 AS `created`, count(`replaced`) AS `destroyed` FROM `" + table + "` INNER JOIN `lb-players` USING (`playerid`) WHERE `playername` = ? AND x > ? AND x < ? AND z > ? AND z < ? AND `replaced` > 0 AND `type` != `replaced` GROUP BY `replaced`)) AS t GROUP BY `type` ORDER BY SUM(`created`) + SUM(`destroyed`) DESC LIMIT 15", Statement.NO_GENERATED_KEYS);
ps = conn.prepareStatement("SELECT `type`, SUM(`created`) AS `created`, SUM(`destroyed`) AS `destroyed` FROM ((SELECT `type`, count(`type`) AS `created`, 0 AS `destroyed` FROM `" + table + "` INNER JOIN `lb-players` USING (`playerid`) WHERE `playername` = ? AND x > ? AND x < ? AND z > ? AND z < ? AND `type` > 0 AND `type` != `replaced` GROUP BY `type`) UNION (SELECT `replaced` AS `type`, 0 AS `created`, count(`replaced`) AS `destroyed` FROM `" + table + "` INNER JOIN `lb-players` USING (`playerid`) WHERE `playername` = ? AND x > ? AND x < ? AND z > ? AND z < ? AND `replaced` > 0 AND `type` != `replaced` GROUP BY `replaced`)) AS t GROUP BY `type` ORDER BY SUM(`created`) + SUM(`destroyed`) DESC LIMIT 15");
ps.setString(1, name);
ps.setInt(2, player.getLocation().getBlockX()-size);
ps.setInt(3, player.getLocation().getBlockX()+size);

View File

@ -26,7 +26,7 @@ public class Rollback implements Runnable
this.conn = conn;
try {
conn.setAutoCommit(false);
ps = conn.prepareStatement("SELECT type, data, replaced, x, y, z FROM `" + table + "` INNER JOIN `lb-players` USING (`playerid`) WHERE playername = ? AND date > date_sub(now(), INTERVAL ? MINUTE) ORDER BY date DESC", Statement.RETURN_GENERATED_KEYS);
ps = conn.prepareStatement("SELECT type, data, replaced, x, y, z FROM `" + table + "` INNER JOIN `lb-players` USING (`playerid`) WHERE playername = ? AND date > date_sub(now(), INTERVAL ? MINUTE) ORDER BY date DESC");
ps.setString(1, name);
ps.setInt(2, minutes);
} catch (SQLException ex) {
@ -41,7 +41,7 @@ public class Rollback implements Runnable
this.conn = conn;
try {
conn.setAutoCommit(false);
ps = conn.prepareStatement("SELECT type, data, replaced, x, y, z FROM `" + table + "` INNER JOIN `lb-players` USING (`playerid`) WHERE playername = ? AND x > ? AND x < ? AND z > ? AND z < ? AND date > date_sub(now(), INTERVAL ? MINUTE) ORDER BY date DESC", Statement.RETURN_GENERATED_KEYS);
ps = conn.prepareStatement("SELECT type, data, replaced, x, y, z FROM `" + table + "` INNER JOIN `lb-players` USING (`playerid`) WHERE playername = ? AND x > ? AND x < ? AND z > ? AND z < ? AND date > date_sub(now(), INTERVAL ? MINUTE) ORDER BY date DESC");
ps.setString(1, name);
ps.setInt(2, player.getLocation().getBlockX()-radius);
ps.setInt(3, player.getLocation().getBlockX()+radius);
@ -60,7 +60,7 @@ public class Rollback implements Runnable
this.conn = conn;
try {
conn.setAutoCommit(false);
ps = conn.prepareStatement("SELECT type, data, replaced, x, y, z FROM `" + table + "` WHERE x > ? AND x < ? AND z > ? AND z < ? AND date > date_sub(now(), INTERVAL ? MINUTE) ORDER BY date DESC", Statement.RETURN_GENERATED_KEYS);
ps = conn.prepareStatement("SELECT type, data, replaced, x, y, z FROM `" + table + "` WHERE x > ? AND x < ? AND z > ? AND z < ? AND date > date_sub(now(), INTERVAL ? MINUTE) ORDER BY date DESC");
ps.setInt(1, player.getLocation().getBlockX()-radius);
ps.setInt(2, player.getLocation().getBlockX()+radius);
ps.setInt(3, player.getLocation().getBlockZ()-radius);