sql fixes in char service

This commit is contained in:
Matt Parnell
2014-08-20 23:31:01 -05:00
parent d979f6e6e5
commit 448ef2b2e6
+2 -2
View File
@@ -422,7 +422,7 @@ public class CharacterService implements INetworkDispatch {
if (isDuplicate) { return true; }
//FIXME: this is a bit lazy... but it's only temporary :p
PreparedStatement psc = databaseConnection.preparedStatement("SELECT * FROM pg_tables WHERE \"tablename\"=?");
PreparedStatement psc = databaseConnection.preparedStatement("SELECT COUNT(*) FROM pg_tables WHERE \"tablename\"=?");
psc.setString(1, "temp_reserved_char_names");
ResultSet resultSetC = psc.executeQuery();
boolean tableExists = resultSetC.next();
@@ -467,7 +467,7 @@ public class CharacterService implements INetworkDispatch {
private String checkForReservedName(String firstName, String lastName) throws SQLException
{
PreparedStatement psc = databaseConnection.preparedStatement("SELECT * FROM pg_tables WHERE \"tablename\"=?");
PreparedStatement psc = databaseConnection.preparedStatement("SELECT COUNT(*) FROM pg_tables WHERE \"tablename\"=?");
psc.setString(1, "reservednames");
ResultSet rsc = psc.executeQuery();
if (!rsc.next()) {