Generally you should not just replace a string that can have any value like a password with another one. The problem is that somebody could enter a password that has the same format of your bcrypt output, and you would have no way of distinguishing the two.
Fortunately the output of your bcrypt function is a string that consist of a version, "salt rounds", the salt and the hash, surrounded by $
separator characters. So the best method of distinguishing the two is to write a regular expression that matches the following output (from the jBCrypt 0.3 source):
rs.append("$2");
if (minor >= 'a')
rs.append(minor);
rs.append("$");
if (rounds < 10)
rs.append("0");
rs.append(Integer.toString(rounds));
rs.append("$");
rs.append(encode_base64(saltb, saltb.length));
rs.append(encode_base64(hashed, bf_crypt_ciphertext.length * 4 - 1));
return rs.toString();
I would however much advice you to add a column to your database that indicates the hash algorithm used on the row, (if any).