PreparedStatements allow you to use placeholders characters (?) in your SQL and fill in the values later. They also handle escaping automatically...
PreparedStatement pstmt = con.prepareStatement("UPDATE contentPage1 SET Content = REPLACE(Content, ?, ?);");
pstmt.setString(1, "first");
pstmt.setString(2, "second - characters like ' will be escaped automatically!");
UPDATE
In the comments below, it sounds like the OP isn't actually trying to use the REPLACE SQL function, they are simply trying to update the data in a given column. Here is some sample code to achieve this (slightly modified version of @TedHopp's comment):
int messageId = 123; // use the PK or unique identifier of the record you want to update
PreparedStatement pstmt = con.prepareStatement("UPDATE contentPage1 SET Content = ? WHERE Id = ?;"); // 'Id' is whatever your PK column is
pstmt.setString(1, "my new message content");
pstmt.setInt(2, messageId);
int numRowsAffected = pstmt.executeUpdate();