I have derby database with table TRIPS. I have 10 columns, but 2 columns:FAIR and TIP should be inserted separately (later when trip on taxi is finished).
Can you please help me to adjust SQL code?
I have this code and it is not working now:
public boolean saveInDB2(String id, String amount, String tip) {
String writeString = "INSERT INTO TRIPS(FAIR, TIP) VALUES ('" + amount +"', '"+ tip +"')" + "WHERE ID = '"+ id +"'";
try {
st.executeUpdate(writeString);
} catch (SQLException sqle){
return false;
}
return true;
}