Class<T> sourceClass) throws SQLException {
StAXSource source = null;
Constructor sourceCtor = null;
Reader reader = null;
XMLInputFactory factory = null;
XMLEventReader eventReader = null;
try {
factory = XMLInputFactory.newInstance();
} catch (FactoryConfigurationError ex) {
throw Exceptions.sourceInstantiation(ex);
}
try {
sourceCtor =
(sourceClass == null)
? StAXSource.class.getConstructor(XMLEventReader.class)
: sourceClass.getConstructor(XMLEventReader.class);
} catch (SecurityException ex) {
throw Exceptions.sourceInstantiation(ex);
} catch (NoSuchMethodException ex) {
throw Exceptions.sourceInstantiation(ex);
}
reader = getCharacterStreamImpl();
try {
eventReader = factory.createXMLEventReader(reader);
} catch (XMLStreamException ex) {
throw Exceptions.sourceInstantiation(ex);
}
try {