Class MySQLConnection
java.lang.Object
dev.jacrispys.JavaBot.utils.mysql.MySQLConnection
Framework for mysql connection queries and updates
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidexecuteCommand(String command) Safe execution of any commandvoidexecuteUpdate(String command) Safe execution of update commandsstatic MySQLConnectiongetMusicChannel(net.dv8tion.jda.api.entities.Guild guild) Obtains current music channel for a given guildvoidobtainConnection(Connection connection) queryCommand(String query) Safe execution of queriesbooleanregisterGuild(net.dv8tion.jda.api.entities.Guild guild, net.dv8tion.jda.api.entities.channel.middleman.GuildMessageChannel defaultChannel) voidsetMusicChannel(net.dv8tion.jda.api.entities.Guild guild, long channelId) Sets the channel for song announcements in a given guild
- 
Constructor Details- 
MySQLConnectionpublic MySQLConnection()
 
- 
- 
Method Details- 
getInstance
- 
obtainConnection
- 
registerGuildpublic boolean registerGuild(net.dv8tion.jda.api.entities.Guild guild, net.dv8tion.jda.api.entities.channel.middleman.GuildMessageChannel defaultChannel) - Parameters:
- guild- guild to register into the DB
- defaultChannel- default notification channel for guild
- Returns:
- boolean if registration was a success
 
- 
executeCommandSafe execution of any command- Parameters:
- command- command to execute
 
- 
executeUpdateSafe execution of update commands- Parameters:
- command- command to update DB variables through
 
- 
queryCommandSafe execution of queries- Parameters:
- query- DB query to execute
- Returns:
- the ResultSet from the query
- Throws:
- SQLException
 
- 
setMusicChannelpublic void setMusicChannel(net.dv8tion.jda.api.entities.Guild guild, long channelId) throws SQLException Sets the channel for song announcements in a given guild- Throws:
- SQLException
 
- 
getMusicChannelObtains current music channel for a given guild- Throws:
- SQLException
 
 
-