Marian / Posted November 23, 2019 Share Posted November 23, 2019 Methode: public static void registerPlayer(ProxiedPlayer p) { if(!existPlayer(p.getUniqueId().toString())) { Freunde.mysql.update("INSERT INTO Freunde(UUID, FList, FRequest, FJump, FOnline, FMessage, FSilent, PInvite, FMaximum, FConnect, FServer, FState) VAULES" + "('" + p.getUniqueId().toString() + "','','','true','true','true,'false','0','100','" + System.currentTimeMillis() + "','Lobby','Keiner');"); } } Fehler: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VAULES('6dbfeaea-e29a-434f-9b2c-1e30eb3698ca','Leer','Leer','true','true','true,' at line 1 Ich weiß nicht weiter vlt kann mir jemand von euch helfen danke im vorraus :) Link to comment Share on other sites More sharing options...
boomer41 Posted November 23, 2019 Share Posted November 23, 2019 'true,'false' Komma und ' verdreht. Bitte lies dir das Thema hier durch, sonst ist dein Datenbankcode unsicher. https://de.wikipedia.org/wiki/SQL-Injection http://openbook.rheinwerk-verlag.de/javainsel9/javainsel_24_008.htm https://docs.oracle.com/javase/tutorial/jdbc/basics/prepared.html Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now