= DriverManager.getConnection("jdbc:mysql://localhost/user", "root", "");
String query = "INSERT INTO admin (fname , lname , age) VALUES (?,?,?)";
PreparedStatement preparedStatement = connection.prepareStatement(query);
preparedStatement.setString(1, "mohsen");
preparedStatement.setString(2, "sh");
preparedStatement.setInt(3, 15);`
preparedStatement.execute();
connection.close();`
Please format the code you posted, by wrapping it in triple backticks. -> `
Обсуждают сегодня