Hello,
I want to connect my app to an SQLite db. I downloaded driver and the .jar from : http://www.ch-werner.de/javasqlite/
For testing purposes i try to run this code:
package com.javaworkspace.connectsqlite;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
public class ConnectSQLite {
public static void main(String[] args) {
Connection connection = null;
ResultSet resultSet = null;
Statement statement = null;
try {
Class.forName("org.sqlite.JDBC");
connection = DriverManager
.getConnection("jdbc:sqlite:/EMPLOYEE.db");
statement = connection.createStatement();
resultSet = statement
.executeQuery("SELECT EMPNAME FROM EMPLOYEEDETAILS");
while (resultSet.next()) {
System.out.println("EMPLOYEE NAME:"
+ resultSet.getString("EMPNAME"));
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
resultSet.close();
statement.close();
connection.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
Now what i don't get is where to put the files:
sqlite_jni.dll (located in: download file->j2sdk1.4.2_03->jre->bin)
sqlite.jar (located in: download folder->j2sdk1.4.2_03->jre->lib->ext)
So where to put them and how to implement them to my eclipse project with the code above.
And if it is important, i use ubuntu.
Thank you, and i'm sorry i bother you with my newbie questions...