I'm trying to use a prepared statement to insert a row into SQL Server table. For one of the columns, I want to insert multi line string but couldn't do it.
String persistQuery = "Insert into employee(Name,Address) values (?, ?)";
try (PreparedStatement serStmt = con.prepareStatement(persistQuery, Statement.RETURN_GENERATED_KEYS){
serStmt.setString(1,name);
serStmt.setString(2,address);
serStmt.executeUpdate();
}
This is inserting a row but is making the value of address as single line. I did make sure that address is multiline text by printing it on console before inserting the values.