Skip to content
This repository has been archived by the owner on Jul 29, 2021. It is now read-only.

MySQL Exception #142

Closed
LightningDesign opened this issue Jun 27, 2019 · 7 comments
Closed

MySQL Exception #142

LightningDesign opened this issue Jun 27, 2019 · 7 comments
Assignees
Labels
bug A failure in the project that causes it to produce an incorrect or unexpected result. help wanted The maintainer is needing some help!

Comments

@LightningDesign
Copy link

LightningDesign commented Jun 27, 2019

The plugin is successfully conected to database. But i think you made a mistake in your Code. If i change the server, the data will not be saved.

all i got is this sql Exception
https://hastebin.com/kuzunajixe.sql
http://prntscr.com/o7idou

[17:12:03] [Server thread/WARN]: 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 'playername` = 'LightningDesign'' at line 1

@weihao weihao added the bug A failure in the project that causes it to produce an incorrect or unexpected result. label Jun 27, 2019
@lgou2w
Copy link
Collaborator

lgou2w commented Jun 28, 2019

@LightningDesign Detailed stack trace dump? And MySQL version?

@LightningDesign
Copy link
Author

Stack trace dump not yet at the moment. But here my sql versions. btw i have over 20 Plugins, that works current with my Database, so i think the problem is not on my side.

https://prnt.sc/o9amsp
and here are the plugins that are currently running:
http://prntscr.com/o9ao5y

i programm with mysql too, so i think the problem is in your sql prepared statements ...

@lgou2w
Copy link
Collaborator

lgou2w commented Jul 2, 2019

According to the stack information, the problem should be here: Line 102

https://github.com/25/EnchantmentsEnhance/blob/400f88d91ca30803a05a7c08da7b3ea0c94b2f25/EnchantmentsEnhance-Plugin/src/main/java/org/pixeltime/enchantmentsenhance/mysql/DataStorage.java#L87-L116

But i tested this StringBuilder spliced SQL with no syntax error:

UPDATE `enchantmentsenhance` SET `failstack` = ?, `items` = ?, `valks` = ?, `grind` = ?WHERE `playername` = ?;

@25 Need help

@lgou2w lgou2w added the help wanted The maintainer is needing some help! label Jul 2, 2019
@LightningDesign
Copy link
Author

Mybe use queryBuilder.append("WHERE 'playername' = ?;"); I mean the " ' " on this part...

@LightningDesign
Copy link
Author

i prefer this method for table updates.

Updater methode:
https://hastebin.com/idegavegur.cpp

get the new data:
https://hastebin.com/denasozepu.cpp

@weihao
Copy link
Owner

weihao commented Jul 8, 2019

@LightningDesign Link is dead. Could you paste the code here on GitHub?

@weihao weihao self-assigned this Jul 8, 2019
@weihao weihao pinned this issue Oct 21, 2019
Soldier233 added a commit to Soldier233/EnchantmentsEnhance that referenced this issue Jan 19, 2020
weihao added a commit that referenced this issue Jan 19, 2020
@weihao
Copy link
Owner

weihao commented Jan 19, 2020

Solved!

Please use the latest release.

@weihao weihao closed this as completed Jan 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug A failure in the project that causes it to produce an incorrect or unexpected result. help wanted The maintainer is needing some help!
Projects
None yet
Development

No branches or pull requests

3 participants