-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Niout edited this page Jul 11, 2020
·
3 revisions
You're about to read the Pulse-API documentation ! If you have some notices about it you can contact the author on discord at Niout#3761 or RenardFute#0001. This api has been created in order to facilitate the creation of minecraft plugin.
You can add a data base thanks to a sql connection easier. To add a sql connection you just have to follow this example :
SQL sql = new SQL("jdbc:mysql//", "YOUR-HOST-HERE", "YOUR-PORT-HERE", "YOUR-DATABASE-HERE", "YOUR-USER-HERE", "YOUR-PASSWORD-HERE");
With this SQL connection, you can do some actions:
- If you want create a new table, you can use the SQLBuilder:
- First, you must initiate a new SQLBuilder :
SQLBuilder sqlBuilder = new SQLBuilder("YOUR-TABLE-NAME")
. - Second, you can add column to this table :
sqlBuilder.addColumn("YOUR-COLUMN-NAME", "YOUR-COLUMN-TYPE", "DEFAULT-VALUE", OPTIONAL-OPTIONS)
- And finally, to push the SQL request and create the table :
sqlBuilder.init(sql)
- First, you must initiate a new SQLBuilder :
- You can also get information from the data base by using SQLManager:
- First, you must initiate a new SQLManager :
SQLManager sqlManager = new SQLManager(sql)
- Second, you can get string or integer or all other object:
sqlManager.getString("TABLE-NAME", "VALUE-NAME", "VALUE", "COLUMN-NAME")
;sqlManager.getInt("TABLE-NAME", "VALUE-NAME", "VALUE", "COLUMN-NAME")
;sqlManager.get("TABLE-NAME", "VALUE-NAME", "VALUE", "COLUMN-NAME")
- And finally, you can insert values :
sqlManager.insert("TABLE-NAME", LIST_OF_VALUE_NAMES, LIST_OF_VALUES)
- First, you must initiate a new SQLManager :
[THIS SECTION IS NOT COMPLETLY FINISH, THE DOCUMENTATION WILL BE ADD LATER SORRY]