there was a problem. When connecting to the database, it does not display any errors, so there are no errors when writing and reading from the database, but the rows are not written to the table, and the reading of the lines also does not occur.
public class DB { private static DB db; private Connection co; Statement st; public static synchronized DB getDB() { if (db == null) { db = new DB(); db.connect(); } return db; } private DB(){ } private void connect(){ try{ co = DriverManager.getConnection("jdbc:sqlite:journal.db"); System.out.println("connect..."); }catch(SQLException ex){ System.out.println(ex.getMessage()); } } public ResultSet select(String query){ ResultSet rs = null; try{ st= co.createStatement(); rs = st.executeQuery(query); st.close(); }catch(SQLException ex){ System.out.println(ex.getMessage()); } return rs; } public void insert(String query){ try{ st = co.createStatement(); st.executeUpdate(query); }catch(SQLException ex){ System.out.println(ex.getMessage()); } }} public abstract class Model { private final DB db; protected Model(){ db = DB.getDB(); } protected ResultSet select(String query){ return db.select(query); } protected void insert(String query){ db.insert(query); }} public class SampleModel extends Model { public boolean isAuth(String login, String pass){ insert("insert into users(login, password) values('admin', 'admin');"); ResultSet rs = select("select * from users;"); System.out.println("select * from users where login = '"+login+"' and password = '"+pass+"'"); try { while (rs.next()) { System.out.println(rs.getString("login")); System.out.println(rs.getString("password")); } rs.close(); } catch (SQLException e) { e.printStackTrace(); } return true; }}