Hi friend, I have wrote servlet program with JDBC and wanted to insert a record into my log file using sql statement. I wanted to insert program variable field values into file field. e.g. Pgm Variable String user = "Joe"; String add="address"; Sql Statement "Insert into log (name, address) values(<user>, <add>)"; How do I insert value from user & add variable into log file in name and address field. what is the syntax. Thank you very much and appreciate quick response as I am developing the pgm and stuck with above problem. Joe Lopes.
posted 16 years ago
You have to build a String: String s = "Insert into log (name, address) values(" + user + " ," + add + " )";