com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'character' at line 1
I'm pretty dumbfounded with this error. Basicly had this base code for every of my project with database but somehow it's just dead.
public ArrayList<Character> display()
{
ArrayList<Character> collection = new ArrayList<>();
try
{
stat = (Statement) connect.createStatement();
result = stat.executeQuery("SELECT * FROM character");
while(result.next())
{
Character a = new Character(
result.getString("user"),
result.getInt("win"),
result.getInt("lose"),
result.getInt("draw")
);
collection.add(a);
}
}
catch(Exception e)
{
System.out.println(e);
}
return collection;
}
chara = new Character();
for(int i = 0; i< chara.display().size();i++)
{
System.out.println("asd");
String message = chara.display().get(i).getUser();
System.out.println(message);
}