Я пытаюсь сделать так, чтобы этот код позволял мне обновлять поля в базе данных доступа, но он продолжает выдавать сообщение "не могу найти символ - метод upDateChesney (java.lang.String, java.lang.String, java.lang.String, java.lang.String
Я пытался переименовать обработчик базы данных, но мне не повезло
private void upDateFireplacesTable()
{
//Defining variables
int code;
//upDate Fireplaces will return a -1 if there is a problem
code = DataBaseHandler.upDateChesney(ID, title, Supplier,price);
//Check to see what code it contains
if (code == -1) //Problem report an error
{
JOptionPane.showMessageDialog (frame, "Problem updating record");
}
//if the update is successfull then the update method will return 1
//(the total number of records updated)
//which would always be 1 since I can only update one record at a time
else if (code == 1)
{
JOptionPane.showMessageDialog (frame, "Record successfully updated");
}
// Ниже приведен код обработчика базы данных
static public int upDateFireplacesTable(String oldIDIn, String newIDIn,String titleIn,String SupplierIn, String priceIn)
{
int code; // This will hold the number of records affected by the
// executeUpDate() method which is used here to UPDATE
// Build the SQL UPDATE string which involves updating a BOOK record
String SQLString = "UPDATE FIREPLACES SET ID = '" + newIDIn + "', Title = '" + titleIn
+ "', Supplier = '" + SupplierIn + "', price = " + priceIn +
" WHERE ID = '" + oldIDIn + "'";
// Update BOOK table
try
{
// The createStatement() method creates a Statement object.
statement = ConnectionToChesneyDB.createStatement();
// executeUpdate() returns the number of records
// affected, in this case it will always be either 0 or
// 1 (since each book's isbn is unique)
code = statement.executeUpdate (SQLString);
}
catch (SQLException exception)
{
return (-1); // Return -1 if some kind of problem encountered
}
return (code); // Return back with the number of records affected
// => 1 in this case.
} // End upDateBook()
Я хочу, чтобы код мог обновлять существующие записи в базе данных