Do not download the JAR manually. Instead, add the following dependency to your pom.xml :
String url = "jdbc:sqlite:sample.db"; try (Connection conn = DriverManager.getConnection(url)) Statement st = conn.createStatement(); st.executeUpdate("CREATE TABLE IF NOT EXISTS test(id INTEGER PRIMARY KEY, name TEXT);"); st.executeUpdate("INSERT INTO test(name) VALUES('Alice');"); ResultSet rs = st.executeQuery("SELECT * FROM test;"); while (rs.next()) System.out.println(rs.getInt("id")+": "+rs.getString("name")); download sqlitejdbc372jar install
rs.close(); stmt.close(); catch (SQLException e) System.err.println("FAILURE: " + e.getMessage()); Do not download the JAR manually
(Simple JAR placement)
Rename the file or adjust your scripts. The driver class is identical – the filename is cosmetic. st.executeUpdate("INSERT INTO test(name) VALUES('Alice')
«Õîááè ìàðêåò» ã.Íîâîñèáèðñê
óë.Èíæåíåðíàÿ, 4à, îô.524
òåë.: +7 (951) 392 1632
òåë.: +7 (383) 32 83 003
Îòêðûòû â ðàáî÷èå äíè ñ 8-00 äî 18-00
