1
我試圖在Eclipse中製作一個註冊程序在Java中。 但我得到了一個錯誤:獲取「查詢不返回結果」SQL異常
java.sql.SQLException: Query does not return results
你可以看到我下面的代碼:
Login.addnewuser(lblname.getText(), lblusername.getText(), lblpseudo.getText(), passwordField.getText(), rankchoice.getSelectedItem());
的
:
public static void addnewuser(String Name, String Username, String Pseudo, String Password, String Rank) {
String query = ("INSERT INTO UsersInfos (Name, Username, Pseudo, Password, Rank) " + "VALUES ('" + Name + "' , '" + Username + "' , '" + Pseudo + "' , '" + Password + "' , '" + Rank + "')");
connection = SqliteConnection.dbConnector();
try {
PreparedStatement name2 = connection.prepareStatement(query);
name2.executeQuery();
} catch (SQLException e) {
e.printStackTrace();
}
}
有人能幫助我嗎?謝謝 :) !
感謝您的迴應,我將嘗試它:)! –
非常感謝安德魯TR! :D –
感謝您的回答:) – mesutpiskin