-2
Hello, my Sqlite connection 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 in Sqlite. I need to enter data in Sqlite to register in the program. The program is for Desktop and not for Android. I am using Eclipse.
Thank you.