Getting error with my sql

I’m getting an error with the code that I got straight from the docs about data bases.
Error:[14:42:51 ERROR] [com.zaxxer.hikari.pool.HikariPool]: HikariPool-1 - Exception during pool initialization. java.sql.SQLException: (conn:67185150) Unknown system variable 'tx_isolation' at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:179) ~[sponge.jar:1.12.2-7.1.6] at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:118) ~[sponge.jar:1.12.2-7.1.6] at org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:245) ~[sponge.jar:1.12.2-7.1.6] at org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:343) ~[sponge.jar:1.12.2-7.1.6] at org.mariadb.jdbc.MariaDbStatement.executeQuery(MariaDbStatement.java:513) ~[sponge.jar:1.12.2-7.1.6] at org.mariadb.jdbc.MariaDbConnection.getTransactionIsolation(MariaDbConnection.java:794) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.pool.PoolBase.checkDriverSupport(PoolBase.java:446) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.pool.PoolBase.setupConnection(PoolBase.java:405) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:363) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:443) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:514) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:111) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:72) ~[sponge.jar:1.12.2-7.1.6] at org.spongepowered.common.service.sql.SqlServiceImpl$1.load(SqlServiceImpl.java:138) ~[sponge.jar:1.12.2-7.1.6] at org.spongepowered.common.service.sql.SqlServiceImpl$1.load(SqlServiceImpl.java:123) ~[sponge.jar:1.12.2-7.1.6] at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3716) ~[minecraft_server.1.12.2.jar:?] at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2424) ~[minecraft_server.1.12.2.jar:?] at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2298) ~[minecraft_server.1.12.2.jar:?] at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2211) ~[minecraft_server.1.12.2.jar:?] at com.google.common.cache.LocalCache.get(LocalCache.java:4154) ~[minecraft_server.1.12.2.jar:?] at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4158) ~[minecraft_server.1.12.2.jar:?] at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5147) ~[minecraft_server.1.12.2.jar:?] at org.spongepowered.common.service.sql.SqlServiceImpl.getDataSource(SqlServiceImpl.java:163) ~[SqlServiceImpl.class:1.12.2-7.1.6] at org.spongepowered.common.service.sql.SqlServiceImpl.getDataSource(SqlServiceImpl.java:144) ~[SqlServiceImpl.class:1.12.2-7.1.6] at devs.logininfo.sql.SQL.getDataSource(SQL.java:36) ~[SQL.class:?] at devs.logininfo.sql.SQL.mysqlSetup(SQL.java:49) ~[SQL.class:?] at devs.logininfo.sql.SQL.init(SQL.java:59) ~[SQL.class:?] at devs.logininfo.LoginInfo.onGameInit(LoginInfo.java:55) ~[LoginInfo.class:?] at org.spongepowered.common.event.listener.GameStartedServerEventListener_LoginInfo_onGameInit3.handle(Unknown Source) ~[?:?] at org.spongepowered.common.event.RegisteredListener.handle(RegisteredListener.java:95) ~[RegisteredListener.class:1.12.2-7.1.6] at org.spongepowered.common.event.SpongeEventManager.post(SpongeEventManager.java:433) ~[SpongeEventManager.class:1.12.2-7.1.6] at org.spongepowered.common.event.SpongeEventManager.post(SpongeEventManager.java:478) ~[SpongeEventManager.class:1.12.2-7.1.6] at org.spongepowered.common.SpongeImpl.postEvent(SpongeImpl.java:252) ~[SpongeImpl.class:1.12.2-7.1.6] at org.spongepowered.common.SpongeImpl.postState(SpongeImpl.java:260) ~[SpongeImpl.class:1.12.2-7.1.6] at org.spongepowered.server.SpongeVanilla.onServerStarting(SpongeVanilla.java:168) ~[SpongeVanilla.class:1.12.2-7.1.6] at net.minecraft.server.dedicated.DedicatedServer.handler$callServerStarting$bbg000(SourceFile:1258) ~[nz.class:?] at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(SourceFile:233) ~[nz.class:?] at net.minecraft.server.MinecraftServer.run(SourceFile:434) ~[MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_231] Caused by: java.sql.SQLException: Unknown system variable 'tx_isolation' Query is: SELECT @@tx_isolation at org.mariadb.jdbc.internal.util.LogQueryTool.exceptionWithQuery(LogQueryTool.java:113) ~[sponge.jar:1.12.2-7.1.6] at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:168) ~[sponge.jar:1.12.2-7.1.6] at org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:337) ~[sponge.jar:1.12.2-7.1.6] ... 36 more [14:42:51 ERROR] [Sponge]: Could not pass GameStartedServerEvent$Impl to Plugin{id=logininfo, name=LoginInfo, version=1.0.0, description=Here lies an example plugin definition, source=mods\[DevS - C] SpongeLoginInfo-1.0.0.jar} com.google.common.util.concurrent.UncheckedExecutionException: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: (conn:67185150) Unknown system variable 'tx_isolation' at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2217) ~[minecraft_server.1.12.2.jar:?] at com.google.common.cache.LocalCache.get(LocalCache.java:4154) ~[minecraft_server.1.12.2.jar:?] at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4158) ~[minecraft_server.1.12.2.jar:?] at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5147) ~[minecraft_server.1.12.2.jar:?] at org.spongepowered.common.service.sql.SqlServiceImpl.getDataSource(SqlServiceImpl.java:163) ~[SqlServiceImpl.class:1.12.2-7.1.6] at org.spongepowered.common.service.sql.SqlServiceImpl.getDataSource(SqlServiceImpl.java:144) ~[SqlServiceImpl.class:1.12.2-7.1.6] at devs.logininfo.sql.SQL.getDataSource(SQL.java:36) ~[SQL.class:?] at devs.logininfo.sql.SQL.mysqlSetup(SQL.java:49) ~[SQL.class:?] at devs.logininfo.sql.SQL.init(SQL.java:59) ~[SQL.class:?] at devs.logininfo.LoginInfo.onGameInit(LoginInfo.java:55) ~[LoginInfo.class:?] at org.spongepowered.common.event.listener.GameStartedServerEventListener_LoginInfo_onGameInit3.handle(Unknown Source) ~[?:?] at org.spongepowered.common.event.RegisteredListener.handle(RegisteredListener.java:95) ~[RegisteredListener.class:1.12.2-7.1.6] at org.spongepowered.common.event.SpongeEventManager.post(SpongeEventManager.java:433) ~[SpongeEventManager.class:1.12.2-7.1.6] at org.spongepowered.common.event.SpongeEventManager.post(SpongeEventManager.java:478) ~[SpongeEventManager.class:1.12.2-7.1.6] at org.spongepowered.common.SpongeImpl.postEvent(SpongeImpl.java:252) ~[SpongeImpl.class:1.12.2-7.1.6] at org.spongepowered.common.SpongeImpl.postState(SpongeImpl.java:260) ~[SpongeImpl.class:1.12.2-7.1.6] at org.spongepowered.server.SpongeVanilla.onServerStarting(SpongeVanilla.java:168) ~[SpongeVanilla.class:1.12.2-7.1.6] at net.minecraft.server.dedicated.DedicatedServer.handler$callServerStarting$bbg000(SourceFile:1258) ~[nz.class:?] at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(SourceFile:233) ~[nz.class:?] at net.minecraft.server.MinecraftServer.run(SourceFile:434) ~[MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_231] Caused by: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: (conn:67185150) Unknown system variable 'tx_isolation' at com.zaxxer.hikari.pool.HikariPool.throwPoolInitializationException(HikariPool.java:543) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:528) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:111) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:72) ~[sponge.jar:1.12.2-7.1.6] at org.spongepowered.common.service.sql.SqlServiceImpl$1.load(SqlServiceImpl.java:138) ~[sponge.jar:1.12.2-7.1.6] at org.spongepowered.common.service.sql.SqlServiceImpl$1.load(SqlServiceImpl.java:123) ~[sponge.jar:1.12.2-7.1.6] at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3716) ~[minecraft_server.1.12.2.jar:?] at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2424) ~[minecraft_server.1.12.2.jar:?] at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2298) ~[minecraft_server.1.12.2.jar:?] at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2211) ~[minecraft_server.1.12.2.jar:?] ... 20 more Caused by: java.sql.SQLException: (conn:67185150) Unknown system variable 'tx_isolation' at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:179) ~[sponge.jar:1.12.2-7.1.6] at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:118) ~[sponge.jar:1.12.2-7.1.6] at org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:245) ~[sponge.jar:1.12.2-7.1.6] at org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:343) ~[sponge.jar:1.12.2-7.1.6] at org.mariadb.jdbc.MariaDbStatement.executeQuery(MariaDbStatement.java:513) ~[sponge.jar:1.12.2-7.1.6] at org.mariadb.jdbc.MariaDbConnection.getTransactionIsolation(MariaDbConnection.java:794) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.pool.PoolBase.checkDriverSupport(PoolBase.java:446) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.pool.PoolBase.setupConnection(PoolBase.java:405) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:363) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:443) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:514) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:111) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:72) ~[sponge.jar:1.12.2-7.1.6] at org.spongepowered.common.service.sql.SqlServiceImpl$1.load(SqlServiceImpl.java:138) ~[sponge.jar:1.12.2-7.1.6] at org.spongepowered.common.service.sql.SqlServiceImpl$1.load(SqlServiceImpl.java:123) ~[sponge.jar:1.12.2-7.1.6] at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3716) ~[minecraft_server.1.12.2.jar:?] at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2424) ~[minecraft_server.1.12.2.jar:?] at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2298) ~[minecraft_server.1.12.2.jar:?] at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2211) ~[minecraft_server.1.12.2.jar:?] ... 20 more Caused by: java.sql.SQLException: Unknown system variable 'tx_isolation' Query is: SELECT @@tx_isolation at org.mariadb.jdbc.internal.util.LogQueryTool.exceptionWithQuery(LogQueryTool.java:113) ~[sponge.jar:1.12.2-7.1.6] at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:168) ~[sponge.jar:1.12.2-7.1.6] at org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:337) ~[sponge.jar:1.12.2-7.1.6] at org.mariadb.jdbc.MariaDbStatement.executeQuery(MariaDbStatement.java:513) ~[sponge.jar:1.12.2-7.1.6] at org.mariadb.jdbc.MariaDbConnection.getTransactionIsolation(MariaDbConnection.java:794) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.pool.PoolBase.checkDriverSupport(PoolBase.java:446) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.pool.PoolBase.setupConnection(PoolBase.java:405) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:363) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:443) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:514) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:111) ~[sponge.jar:1.12.2-7.1.6] at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:72) ~[sponge.jar:1.12.2-7.1.6] at org.spongepowered.common.service.sql.SqlServiceImpl$1.load(SqlServiceImpl.java:138) ~[sponge.jar:1.12.2-7.1.6] at org.spongepowered.common.service.sql.SqlServiceImpl$1.load(SqlServiceImpl.java:123) ~[sponge.jar:1.12.2-7.1.6] at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3716) ~[minecraft_server.1.12.2.jar:?] at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2424) ~[minecraft_server.1.12.2.jar:?] at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2298) ~[minecraft_server.1.12.2.jar:?] at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2211) ~[minecraft_server.1.12.2.jar:?] ... 20 more

java.sql.SQLException: Unknown system variable 'tx_isolation' Query is: SELECT @@tx_isolation

What database server and version are you using? It could be a problem with the driver not being compatible with it.

This may be helpful:

How can I update the driver? It works with an older sql database but not with a new one.

The mysql/mariadb connector comes with Sponge.
It looks like sponge hasn’t updated it in a while, 2.0.3 is from 2017.

You may be able to bundle a later version in your plugin, though I don’t know if that’ll work
The connector can be downloaded here: https://downloads.mariadb.org/connector-java/+releases/