Ah, no, I thought this was for 'personal' use. You can't use this method in a launcher because the security risk is way too high. You have two options...
Create a new packet to communicate with the server
What you would have to do is create a connection with the server itself, probably read the clientinfo.xml, and then send the information you want to the server. In packets.h you would add a new packet that you can treat yourself. This is similar to what a WPE tool would do I guess.
Keep using SQL
You could stick with SQL... Create a new user with very limited access (only grant them the insert command). That way you could use the code above but by using that restricted account, they wouldn't be able to do anything even if they found out your connection username/password. The only abuse I can think of is that someone might end up spamming the DB with insert commands, but... this can happen with any other solution you come up with anyway.
Hmm, the problem is that a person with high knowledge could insert cash points, or other values in DB, right? Or there is a way to give permission to note the all tables?
Maybe I have to pick the first solution, more "safe", I think I will take a look at Openkore bots and see the connections maked by it.