You have been mistaken the issue.
There are two facts to this point:
1) a String varibale in Java can handle any charactor combinations and can be output by using out.print statement.
2) a field in database with varchar type can store any charactor sequence, like the one you are facing.
Were you are using a test string in java itself, you're going to have to back slash / problem.
In fact, you can use a query to get the value from database and store it in the variable and there is no problem with that.
Use a prepared statement to get the string value instead of query string. You will get it.