[DS-1614] MetadataExport logs and prints a stacktrace if SQLException is thrown.

If an other Exception occurs the program will crash and leave the user with a stacktrace.