- Баллы
- 76
Вместо name мне нужно получить sender(тоисть отправителя команды, сама команда прописана в другом классе)
public int GetMoney(String name) throws Exception {
String tableName = this.plugin.getConfig().getString("tableName");
String dbNames = this.plugin.getConfig().getString("columnFirst");
String dbBalance = this.plugin.getConfig().getString("columnSecond");
Connection c = this.getConnection();
Statement s = c.createStatement();
ResultSet res = s.executeQuery("SELECT " + dbBalance +" FROM "+ tableName +" WHERE " + dbNames +" = '"+ name +"'" );
res.next();
return res.getInt(dbBalance);
}
public int GetMoney(String name) throws Exception {
String tableName = this.plugin.getConfig().getString("tableName");
String dbNames = this.plugin.getConfig().getString("columnFirst");
String dbBalance = this.plugin.getConfig().getString("columnSecond");
Connection c = this.getConnection();
Statement s = c.createStatement();
ResultSet res = s.executeQuery("SELECT " + dbBalance +" FROM "+ tableName +" WHERE " + dbNames +" = '"+ name +"'" );
res.next();
return res.getInt(dbBalance);
}