if (connectionInfo.getDataSource() != null) {
writer.writeAttribute("dataSource", connectionInfo.getDataSource());
}
ConnectionProperties connectionProperties = connectionInfo.getConnectionProperties();
if (connectionProperties != null) {
writer.writeStartElement(CONNECTION_PROPERTIES.getNamespaceURI(), CONNECTION_PROPERTIES.getLocalPart());
if (connectionProperties.getDriverClass() != null) {
writer.writeAttribute("driverClass", connectionProperties.getDriverClass());
}
if (connectionProperties.getDatabaseURL() != null) {
writer.writeAttribute("databaseURL", connectionProperties.getDatabaseURL());
}
if (connectionProperties.getUsername() != null) {
writer.writeAttribute("username", connectionProperties.getUsername());
}
if (connectionProperties.getPassword() != null) {
writer.writeAttribute("password", connectionProperties.getPassword());
}
if (connectionProperties.getLoginTimeout() != null) {
writer.writeAttribute("loginTimeout", String.valueOf(connectionProperties.getLoginTimeout()));
}
writer.writeEndElement();
}