SQLite driver not found with OrmLite

Hi, I am trying to use Ormlite with a sqlite database and it just doesn't work and I don't know why. Here is my code:
Class.forName("org.sqlite.JDBC");

String databaseUrl = "jdbc:sqlite:data.db";
connectionSource = new JdbcConnectionSource(databaseUrl);
Class.forName("org.sqlite.JDBC");

String databaseUrl = "jdbc:sqlite:data.db";
connectionSource = new JdbcConnectionSource(databaseUrl);
pom.xml
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.46.1.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.46.1.3</version>
<scope>compile</scope>
</dependency>
No description
15 Replies
JavaBot
JavaBot•2mo ago
⌛ This post has been reserved for your question.
Hey @TomasGnG 😴! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
TomasGnG 😴
TomasGnG 😴OP•2mo ago
Please @ me when replying
dan1st
dan1st•2mo ago
Is there any reason you need the Class.forName?
TomasGnG 😴
TomasGnG 😴OP•2mo ago
I found it online
dan1st
dan1st•2mo ago
It was used in the past but it isn't necessary any more
TomasGnG 😴
TomasGnG 😴OP•2mo ago
No description
dan1st
dan1st•2mo ago
Try updating your Maven project I think you should have a Maven tab on the right in IntelliJ
TomasGnG 😴
TomasGnG 😴OP•2mo ago
Yes How do I update? Is there a mvn command?
dan1st
dan1st•2mo ago
If you open that tab, there should be a reload symbol on the left of the top Maven tab
TomasGnG 😴
TomasGnG 😴OP•2mo ago
clicked it
dan1st
dan1st•2mo ago
that's what's meant with updating the project Try running it again now
TomasGnG 😴
TomasGnG 😴OP•2mo ago
omg no way
No description
TomasGnG 😴
TomasGnG 😴OP•2mo ago
Thank you very much!
JavaBot
JavaBot•2mo ago
If you are finished with your post, please close it. If you are not, please ignore this message. Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
JavaBot
JavaBot•2mo ago
Post Closed
This post has been closed by <@386870647894048768>.
Want results from more Discord servers?
Add your server