Hello, my connection to SQLite is as follows:
Connection connection = null;
try
{
// create a database connection
connection = DriverManager.getConnection("jdbc:sqlite:database.db");
Statement statement = connection.createStatement();
statement.setQueryTimeout(30); // set timeout to 30 sec.
statement.executeUpdate("CREATE TABLE IF NOT EXISTS person (id INTEGER PRIMARY KEY AUTOINCREMENT, name STRING, address STRING, telephone STRING, celphone STRING, email STRING, cpf STRING, password STRING)");
}
catch(SQLException e){ System.err.println(e.getMessage()); }
}
Is this connection correct? I would also like to know how to insert data into SQLite. I need to enter data in SQLite to make registrations in the program. The program is for Desktop and not for Android. I'm using Eclipse.
Thank you.