I suggest you take that line of code and rewrite it to have only one method call per line. That way you might have a better chance of being able to understand what it's doing.
You are repeatedly adding text to the end of the StringBuilder, then getting its value as a String with the toString method and applying the name "database" to that with the assign operator.