I get an error: Unknown column 'a' in 'field list'. The values i have entered are: edit_name=a, edit_ip=b, edit_os=c, edit_ram=123, old_name=1(I have 4 records with that name). Here is my code, how to fix this issue?
public static void EditInformation(String old_name, String edit_name, String edit_IP, String edit_OS, int edit_RAM, Connection conn, String url, String dbName, String driver, String userName, String password){ try { Class.forName(driver).newInstance(); conn=DriverManager.getConnection(url+dbName, userName, password); try { Statement st = conn.createStatement(); int val=st.executeUpdate("UPDATE server "+ "SET name="+edit_name+",ip="+edit_IP+",os="+edit_OS+",ram="+edit_RAM+" "+ "WHERE name="+old_name); } catch(SQLException s){ System.out.println("SQL statement is not executed!"); } } catch (Exception e){ e.printStackTrace(); } }