Best way to use MySQL?

Discussion in 'Plugin Development' started by NerdsWBNerds, Jun 2, 2014.

Thread Status:
Not open for further replies.
  1. Offline


    I know it probably wouldn't matter that much, but if I was doing a lot of stuff with databases, would it be more efficient to directly use MySQL from Java, or call a PHP page with 'get' variables to query the databases?
  2. Offline


    I would say to use it directly with Java. Less work.
  3. Offline

    Lolmewn Retired Staff

    You're pretty much doing the same but in a different language. I'd say Java directly since you're already coding in Java anyway. And please, do queries async of the main thread :3
  4. Offline


    I do queries in async :3
    Plus, I actually started out in HTML/PHP and all the good stuff, so it's not like I'd be teaching myself something new.
  5. Offline


    I would suggest using the Java side. Mainly because PHP would need to reconnect to the database every time you send a GET request, which as you might imagine will slow things down and add a fair bit of overhead (1 connection to do everything (Java) vs. a connection per request (PHP))...
  6. Offline


    NerdsWBNerds I would suggest using just Java simply because why on earth would you combine it with PHP for that? Not only is that pointless, it adds more room for things to go wrong and can easily be less efficient that way. Sure you could do the MySQL queries using PHP, you can do a whole bunch of things Java can do in PHP! That doesn't at all mean that you should, though.
    Garris0n likes this.
  7. Offline


    I think the real question here is why anyone would willingly add PHP to anything.
  8. Offline


    Garris0n Eh, PHP has its uses. Just not at all when you're doing this stuff :p
Thread Status:
Not open for further replies.

Share This Page