There is no equivalent in Java to PHP magic quotes. Java isn't static like PHP is, so it can monitor in real time these values. Not like you'd want to use it anyway, magic_quotes_gpc in PHP was a terrible idea right from the start.
I'm also not familiar with anything like the real_escape_string in PHP. I've always used prepared statements with Java sql.