#MySQL connection

30 messages · Page 1 of 1 (latest)

ivory ingot
#

Can someone provide me a working mysql connection using KubeJS 6? I know that it should be done using jdbc connection but I don’t know how to import the drivers.
I have the database instance on the server and I want to perform CRUD operations through KubeJS 🙂

molten orioleBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

halcyon blaze
#

i think theres an addon for it. not sure if its been marked as 1.20 yet

ivory ingot
#

Hmm I saw that KubeJS 5 supports jdbc

halcyon blaze
#

where??

ivory ingot
#

Using the import

#

But I don’t know where to import the J Connector library

#

In which folder

#

Umm I read it somewhere in the net but didn’t test it cuz I’m using version 6

halcyon blaze
#

if its a part of the standard jre/jdk then you can just import the classes with Java.loadClass('classpath here'), otherwise you need a mod to add those classes for you

halcyon blaze
#

aha thats the addon i was thinking of

tribal vapor
#

forge sadly and 1.18, but he can still look around to find newer versions and fabric

halcyon blaze
#

the jar is marked for 1.20.1

#

it should load on fabric too (if it doesnt already) by just adding a fabric.mods.json

ivory ingot
#

But I think that the j connector is not included in java’s jdk

cyan jay
#

why would you need to perform crud operations though? are you storing a large amount of data somewhere?

ivory ingot
#

I am not, will gonna implement money system

#

But I need to store it after the server is restarted

#

Is there any other way to do so?

cyan jay
#

there is such thing as persistent data, which you can use without needing a mySQL connection

#

just store data on the player or on the level or server

#

if you really need it that safe then you'll store it on the server

ivory ingot
#

How to store on the server?

#

And how to read it and update

#

Could you provide me an example?

lusty wigeon
#

And ofc you can do the same on the ServerEvents.tick and iterate over all players

ivory ingot
#

Hmmm ok, will try it