Click here to Skip to main content
15,879,239 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have created small code of sqlite database in java.

Below is the code for connection with database,

C#
Class.forName("org.sqlite.JDBC");
objConnection = DriverManager.getConnection("jdbc:sqlite:/etc/javaData/Test.db");


In this code the exception thrown in second line for getConnection(). I am trying this code on Raspberry pi. How to fix the exceptionrelated to this

Exception

Exception Message: Error opening connection Stack Trace: java.sql.SQLException: Error opening connection at org.sqlite.core.CoreConnection.open(CoreConnection.java:140) at org.sqlite.core.CoreConnection.<init>(CoreConnection.java:66) at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:21) at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:23) at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:45) at org.sqlite.JDBC.createConnection(JDBC.java:114) at org.sqlite.JDBC.connect(JDBC.java:88) at java.sql.DriverManager.getConnection(DriverManager.java:571) at java.sql.DriverManager.getConnection(DriverManager.java:215
Posted
Updated 27-Jan-15 17:58pm
v2

1 solution

Did you install a driver for the sqlite? You are facing a connection problem, not a programming problem.
SQLite Driver[^]

Video Tutorial[^]

Have fun!
 
Share this answer
 
Comments
CPallini 28-Jan-15 3:13am    
5.
Member 10168792 28-Jan-15 4:07am    
I have already used sqlite-jdbc 3.8.6.jar

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900