// Create table and query to test fully Statement stmt = conn.createStatement(); stmt.execute("CREATE TABLE test (id INTEGER)"); stmt.execute("INSERT INTO test VALUES (372)"); ResultSet rs = stmt.executeQuery("SELECT id FROM test"); if (rs.next() && rs.getInt(1) == 372) System.out.println("SUCCESS: sqlite-jdbc-3.72 is working correctly."); rs.close(); stmt.close(); catch (SQLException e) System.err.println("FAILURE: " + e.getMessage());
Then run:
dependencies implementation 'org.xerial:sqlite-jdbc:3.72.0' download sqlitejdbc372jar install
If you use Maven, you don't manually download the JAR. Maven handles it automatically. 3.1 Add Dependency to pom.xml Open your project's pom.xml and add the following inside the <dependencies> section: // Create table and query to test fully
mvn dependency:tree | grep sqlite-jdbc For Gradle (Kotlin DSL or Groovy): stmt.execute("CREATE TABLE test (id INTEGER)")