What do I have to do to avoid error of "out of memory", when connection by jdbc with sqlite3 database?
java.sql.SQLException: out of memory
at org.sqlite.DB.throwex(DB.java:288)
at org.sqlite.NestedDB._open(NestedDB.java:73)
at org.sqlite.DB.open(DB.java:77)
at org.sqlite.Conn.<init>(Conn.java:88)
at org.sqlite.JDBC.connect(JDBC.java:64)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at action.Actions.<init>(Actions.java:18)
at controler.ClientControler.<init>(ClientControler.java:14)
at main.Main.main(Main.java:20)
Class.forName("org.sqlite.JDBC");
conn = DriverManager.getConnection("jdbc:sqlite:clients.db");
I just faced the same problem and I solved it . I was using IntelliJ as my IDE. I will show you how i fixed the problem by screen shots , step by step. Hope this will help you .
1- go to view | tool windows | database .
2- now a window containing the name of your databases is open in the right hand.select the database you want , then tap "alt+Enter"
now , on the opened window , make sure that you have filled the textboxes correct ! (they should include the "fileName" . directory is not enough!!)
If path to your database contains any spaces JDBC can't find it. For example
C:/Program Files
is wrong. Must beC:/Program_Files
. I had same problem and now it works.This suggests that your
clients.db
file couldn't be found. Try locating that file more appropriately. Scroll down to the section entitled "How to Specify Database Files".I downloaded the SQLite JAR, put it in my CLASSPATH, and found a tutorial here that worked perfectly in less than five minutes. It put test.db in my project root, as expected.
I've rewritten that tutorial the way I'd do it. It works. Don't say it brings nothing.
I came across this issue trying to connect via Eclipse's "Data Source Explorer".
On a Mac, when I double clicked the file name in the browse prompt the database location was populated with the folder and the database with the file name. When I manually added the database file to the "Database Location" field I was then able to connect.
I have the same problem here, and I think we have run into some bug. The exception is absolutely not caused by "the file non existing": I carefully checked it with a proper test case.
The database itself is created using sqlite3 official command line tool, so no corrupt database either. I can safely tell you the lib is broken somehow.
Please tell me what is your OS and JVM version so that I see if it matches mine, and we can prepare a bug report.
I had the same problem. My solution is update the dependency sqlite-jdbc from version 3.7.2 to 3.16.1