Skip to content

Commit

Permalink
Fix incorrect database datatype
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Jan 23, 2014
1 parent 5ba8457 commit 6af0dda
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/main/java/net/citizensnpcs/api/util/DatabaseStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,7 @@ public boolean keyExists(String key) {
@Override
public String name() {
Traversed t = traverse(path, true);
System.err.println(t);
return t.key != null ? t.key : t.found.name;
return t.key != null ? t.key : t.found != null ? t.found.name : "";
}

@Override
Expand Down Expand Up @@ -447,7 +446,7 @@ public void setDouble(String key, final double value) {

@Override
public void setInt(String key, final int value) {
setValue("STRING", key, value);
setValue("INT", key, value);
}

@Override
Expand Down Expand Up @@ -480,12 +479,10 @@ private void setValue(String type, String key, Object value) {
closeQuietly(stmt);
t.found.addColumn(t.column);
}
queryRunner.update(conn, "UPDATE " + t.found.name + " SET " + t.column + "=? WHERE "
+ t.found.primaryKey + "=?", value, t.key);
queryRunner.update(conn, "UPDATE `" + t.found.name + "` SET `" + t.column + "`=? WHERE `"
+ t.found.primaryKey + "`=?", value, t.key);
} catch (SQLException ex) {
ex.printStackTrace();
System.out.println("UPDATE " + t.found.name + " SET " + t.column + "=? WHERE " + t.found.primaryKey
+ "=?" + " " + value + " " + t.key);
}
}

Expand Down

0 comments on commit 6af0dda

Please sign in to comment.