Updated MySQL connector to 8.x
This commit is contained in:
1 parent
c92b9317de
commit
967856ce57
3 files changed
+99
-3
No files matched your search
@@ -0,0 +1,95 @@
|
||||
-- Database for the bot
|
||||
|
||||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||
SET AUTOCOMMIT = 0;
|
||||
START TRANSACTION;
|
||||
SET time_zone = "+00:00";
|
||||
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8mb4 */;
|
||||
|
||||
--
|
||||
-- Base de données : `netneutrality`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Structure de la table `blacklist`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `blacklist`;
|
||||
CREATE TABLE IF NOT EXISTS `blacklist` (
|
||||
`word` varchar(255) NOT NULL,
|
||||
`serverId` varchar(255) NOT NULL,
|
||||
`isEnabled` tinyint(4) NOT NULL,
|
||||
`creatorId` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`word`,`serverId`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Structure de la table `guilds`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `guilds`;
|
||||
CREATE TABLE IF NOT EXISTS `guilds` (
|
||||
`guild_id` varchar(255) NOT NULL,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`owner` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`guild_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Structure de la table `logging`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `logging`;
|
||||
CREATE TABLE IF NOT EXISTS `logging` (
|
||||
`serverId` varchar(255) NOT NULL,
|
||||
`channelId` varchar(255) NOT NULL,
|
||||
`enabled` tinyint(4) NOT NULL,
|
||||
PRIMARY KEY (`serverId`,`channelId`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Structure de la table `log_message`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `log_message`;
|
||||
CREATE TABLE IF NOT EXISTS `log_message` (
|
||||
`serverName` varchar(255) NOT NULL,
|
||||
`channelName` varchar(255) NOT NULL,
|
||||
`userName` varchar(255) NOT NULL,
|
||||
`dateSent` varchar(255) NOT NULL,
|
||||
`messageId` varchar(255) NOT NULL,
|
||||
`message` varchar(2000) DEFAULT NULL,
|
||||
`editedMessage` varchar(2000) DEFAULT NULL,
|
||||
PRIMARY KEY (`messageId`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Structure de la table `settings`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `settings`;
|
||||
CREATE TABLE IF NOT EXISTS `settings` (
|
||||
`skey` varchar(60) NOT NULL,
|
||||
`value` varchar(2048) NOT NULL,
|
||||
PRIMARY KEY (`skey`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
COMMIT;
|
||||
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
@@ -58,7 +58,7 @@
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>5.1.45</version>
|
||||
<version>8.0.26</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package netneutrality.db;
|
||||
|
||||
import com.mysql.cj.jdbc.MysqlConnectionPoolDataSource;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource;
|
||||
|
||||
public class MysqlConnector {
|
||||
|
||||
@@ -34,7 +35,7 @@ public class MysqlConnector {
|
||||
dataSource.setPort(3306);
|
||||
dataSource.setDatabaseName(dbName);
|
||||
dataSource.setAutoReconnect(true);
|
||||
dataSource.setAutoReconnectForConnectionPools(true);
|
||||
dataSource.setAutoReconnectForPools(true);
|
||||
c = dataSource.getConnection();
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user