0

I am trying to write my database to XML using ddlutils, but I needed a try/catch block. However, when I used the following code I am getting the error "Incompatible types: Required: java.lang.throwable Found: org.apache.ddlutils.DdlUtilsException"

public void writeDBToXML(Database db, String fileName) {
    try {
        new DatabaseIO().write(db, fileName);
    } catch (DdlUtilsException e) {
        //e.printStackTrace();
    }
}
dgelinas21
  • 641
  • 3
  • 9
  • 22
  • Where is `DatabaseIO` defined? What does it have in the `throws` clause of its constructor and `write` method? – Itai Mar 01 '17 at 14:41
  • DatabaseIO is a type included in the apache import – dgelinas21 Mar 01 '17 at 15:02
  • @sillyfly seems like the throws clause is there ( https://db.apache.org/ddlutils/api/org/apache/ddlutils/io/DatabaseIO.html#write(org.apache.ddlutils.model.Database,%20java.lang.String) ) and since the exception extends `RuntimeException` there should be no need for a `throws` clause... – fabian Mar 01 '17 at 17:16

0 Answers0