String sql = "insert into User values('" + username + "','"+
password1 + "','" + sex + "','" + phoneNumber + "','"+
email + "','" + hobby + "')";
st.executeUpdate(sql);
應該是這裡 哪裡錯了呢
com.microsoft.sqlserver.jdbc.SQLServerException: 關鍵字 'User' 附近有語法錯誤。
user在sqlserver中是關鍵字,需要[user]方式表示
String sql = "insert into [User] values('" + username + "','"+
password1 + "','" + sex + "','" + phoneNumber + "','"+
email + "','" + hobby + "')";