There is many plugins that using mysql. And EACH using OWN config and connection to db. I suggest this plugin, which connection can use any other plugin.
import me.tabr.mysqldbconnection.MDBCMain; //+import sql u need ... MDBCMain mdbc = (MDBCMain)this.getServer().getPluginManager().getPlugin("mdbc"); mdbc.Test();//to test =) Statement s = mdbc.getStmt(); //and use statement as always =)
import me.tabr.mysqldbconnection.MDBCMain; ... MDBCMain mdbc = (MDBCMain)this.getServer().getPluginManager().getPlugin("mdbc"); ArrayList<ArrayList<String>> result =mdbc.executeQuery("SELECT * FROM iConomy"); for (int i=0;i<result.size();i++) { ArrayList<String> result1 = result.get(i); String out=""; for (int j=0;j<result1.size();j++) { out+=result1.get(j)+" "; } log.info("[test] "+out); }
PS: don't forget to add 'depend: [mdbc]' to your 'plugin.yml'
PPS: sorry for my english