例外:
查看与您的MariaDB服务器版本相对应的手册 在第1行的``Name'','ID')VALUES('','')'附近使用正确的语法
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
try {
String Name="Jack";
int ID = 21;
String q="insert into student values(?,?)";
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/Student", "root", "");
PreparedStatement st = con.prepareStatement(q);
st.setString(1,Name);
st.setString(2,ID);
int c=st.executeUpdate();
System.out.print(c);
} catch (Exception e) {
System.out.print(e);
}
}