Answer the question
In order to leave comments, you need to log in
How to properly connect to a database (SQLite) and how to pass values to it?
// --------ПОДКЛЮЧЕНИЕ К БАЗЕ ДАННЫХ--------
public static void Conn() throws ClassNotFoundException, SQLException
{
conn = null;
Class.forName("org.sqlite.JDBC");
conn = DriverManager.getConnection("jdbc:sqlite:TEST1.s3db");
System.out.println("База Подключена!");
}
public static void WriteDB(String login, String name, String password) throws ClassNotFoundException, SQLException
{
statmt = conn.createStatement();
statmt.execute("INSERT INTO 'users' ('login', 'name', 'password') VALUES (login, name, password); ");INT);");
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question