MySQL: what does this error mean?

Au
- in Plugins
2

I have this problem. I'm trying to create a table in my Java Minecraft plugin. The following error then appears in the console:

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 '), BANK DOUBLE (300), BOUNTY DOUBLE (300), JOB VARCHAR (100), PRIMARY KEY (UUID))' at line 1

My JavaCode goes like this (that should be the place where the error occurs):

ps = plugin.getMySQL (). GetConnection (). PrepareStatement ("CREATE TABLE IF NOT EXISTS usermoney (NAME VARCHAR (100), UUID VARCHAR (100), WALLET DOUBLE (300), BANK DOUBLE (300), BOUNTY DOUBLE (300 ), JOB VARCHAR (100), PRIMARY KEY (UUID)) ");
ps.executeUpdate ();
Bukkit.getConsoleSender (). SendMessage (plugin.prefix + "§aTable now exists");

Re

DOUBLE (300)

What is that supposed to be? A 300-digit number without decimal places or what? It won't work that way. Just leave it out and stick with DOUBLE.

Apart from that, DECIMAL is usually used for amounts of money with decimal places. This saves you the crumbs with floating point representation.

El

The DOUBLE values:

either without any value behind it (i.e. Only via e.g. "wallet DOUBLE")

or with complete decimal restriction (including decimal places), but then the number of places max. 255, e.g. "wallet DOUBLE (255,2)"