0
我不知道爲什麼我有這樣的錯誤......請,如果有人能告訴我什麼是錯在此:你在你的SQL語法錯誤com.mysql.jdbc.exception你的sql語法有錯誤;
com.mysql.jdbc.exception;檢查對應於你的MySQL服務器版本的手冊正確的語法使用
mat_pay="maybe";
Class.forName("com.mysql.jdbc.Driver");
connec = DriverManager.getConnection("jdbc:mysql://localhost/babe","root","");
stmt = connec.prepareStatement("INSERT INTO ? VALUES (, ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?) ");
stmt.setString(1,mat_pay);
stmt.setInt(2,septembre.var_m_p_g1); //septembre.var_m_p_g1 has a value 'integer'
stmt.setInt(3,id_g2); //septembre.var_m_p_g1 has a value 'integer'
stmt.setInt(4,0);
stmt.setInt(5,0);
stmt.setInt(6,0);
stmt.setInt(7,0);
stmt.setInt(8,0);
stmt.setInt(9,0);
stmt.setInt(10,0);
stmt.setInt(11,0);
stmt.setInt(12,0);
stmt.setInt(13,0);
stmt.executeUpdate();
可能有更多的問題,但很難說,因爲你沒有打算格式化你的代碼。你要求人們來幫助你,所以你最好有興趣讓他們輕鬆地做到這一點。 – MarsAtomic
發佈(使用[edit]添加到您的問題)您期望執行的確切SQL。 –