vendredi 13 mars 2015

Inserting values for mysql table which is having auto increment id using java



when i run the application it's not showing any error but table was not updated correct me with showing the error



String sql = "INSERT INTO tree_msc (table_names) VALUES (?)";
PreparedStatement preparedStatement = (PreparedStatement)
conn.prepareStatement(sql,Statement.RETURN_GENERATED_KEYS);
preparedStatement.setString(1, tble_name);
preparedStatement.executeUpdate();


Thanx




Aucun commentaire:

Enregistrer un commentaire