Created
June 16, 2017 19:48
-
-
Save HelixOW/3f3f9d90faf158a2cd96c84ef09d380d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ExamplePlugin extends JavaPlugin { | |
private static MySQLDatabase database; | |
public void onEnable() { | |
for (MySQLAPI api : MySQLAPI.getMysqlDBs()) { | |
api.initMySQLAPI(); | |
database = new MySQLDatabase("Example", api.getDatabase()); | |
} | |
database.create(database.createColumn("UUID", MySQLAPI.MySQLDataType.VARCHAR, 50), | |
database.createColumn("Some Column", MySQLAPI.MySQLDataType.TEXT, 5000000), | |
database.createColumn("etc"...)); | |
database.insert(playerUUID, someValue, ...) //insert a new row into the database | |
database.update("UUID", playerUUID, "column", "new Value for column") //updates a column inside the row where playerUUID matches the given UUID | |
database.getResult("UUID", playerUUID.toString(), "Some Column") //returns object inside the column "Some Column" | |
} | |
public static MySQLDatabase getDatabase() { | |
return database; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment