Hi, as the title suggests I have a problem with sqlite. In practice when I try to open the connection it is not opened and it gives me an error message. I have already tried, as I have read in other discussions, to add libraries such as the one available on the official website (mysql-connector-java-8.0.19) but the same problem continues. Stacktrace Spoiler java.sql.SQLException: No suitable driver found for jbdc:sqlite:C:\Users\ObsidianPvP\Desktop\Server\plugins\Obsidian\storage.db [10:59:56 WARN]: at java.sql.DriverManager.getConnection(Unknown Source) [10:59:56 WARN]: at java.sql.DriverManager.getConnection(Unknown Source) [10:59:56 WARN]: at www.obsidianpvp.eu.Database.<init>(Database.java:17) [10:59:56 WARN]: at www.obsidianpvp.eu.Obsidian.onEnable(Obsidian.java:47) [10:59:56 WARN]: at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) [10:59:56 WARN]: at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340) [10:59:56 WARN]: at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [10:59:56 WARN]: at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:357) [10:59:56 WARN]: at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:317) [10:59:56 WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:414) [10:59:56 WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:378) [10:59:56 WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:333) [10:59:56 WARN]: at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:263) [10:59:56 WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [10:59:56 WARN]: at java.lang.Thread.run(Unknown Source)
The one available at this address -> https://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-8.0.19.zip but I also tried with the one taken from bitbuket at https://bitbucket.org/xerial/sqlite-jdbc/downloads/
Are you trying to use MySQL driver for SQLite?! Anyway, you have to Class.forName the suitable (SQLite) driver before trying to use it.
Now i change the order of code strings and it send a new error: java.sql.SQLException: invalid database address + "my path"
Ok, now is something like this, Code (Java): this.connection = DriverManager.getConnection("jbdc:sqlite:" + new File(file)); but don't work and i get the same error
He doesn't know to connect to the sqlite db. I linked a tutorial showing exactly what addresses are possible:
The File needs the directors made also if the database.db is made as a folder you will face the same errors