Package org.frankframework.util
Class DB2XMLWriter
java.lang.Object
org.frankframework.util.DB2XMLWriter
Transforms a java.sql.Resultset to a XML stream.
Example of a result:
<result>
<fielddefinition>
<field name="FIELDNAME"
type="columnType"
columnDisplaySize=""
precision=""
scale=""
isCurrency=""
columnTypeName=""
columnClassName=""/>
<field ...../>
</fielddefinition>
<rowset>
<row number="1">
<field name="FIELDNAME">value</field>
<field name="FIELDNAME" null="true"></field>
<field name="FIELDNAME">value</field>
<field name="FIELDNAME">value</field>
</row>
</rowset>
</result>
Note: that the fieldname and columntype are always capital case!- Author:
- Johan Verrips
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddFieldDefinitions(SaxElementBuilder root, ResultSetMetaData rsmeta) static StringgetFieldType(int type) Get the presentation of aNullvaluestatic StringgetRowXml(IDbmsSupport dbmsSupport, ResultSet rs, int rowNumber, ResultSetMetaData rsmeta, String blobCharset, boolean decompressBlobs, String nullValue, boolean trimSpaces, boolean getBlobSmart) static voidgetRowXml(SaxElementBuilder rows, IDbmsSupport dbmsSupport, ResultSet rs, int rowNumber, ResultSetMetaData rsmeta, String blobCharset, boolean decompressBlobs, String nullValue, boolean trimSpaces, boolean getBlobSmart) getXML(IDbmsSupport dbmsSupport, CallableStatement callableStatement, boolean alsoGetResultSets, Map<Integer, IParameter> outputParameters, int maxRows, boolean includeFieldDefinition) voidgetXML(IDbmsSupport dbmsSupport, CallableStatement callableStatement, boolean alsoGetResultSets, Map<Integer, IParameter> outputParameters, int maxRows, boolean includeFieldDefinition, ContentHandler handler, boolean prettyPrint) getXML(IDbmsSupport dbmsSupport, ResultSet rs) Retrieve the Resultset as a well-formed XML stringgetXML(IDbmsSupport dbmsSupport, ResultSet rs, int maxRows) Retrieve the Resultset as a well-formed XML stringgetXML(IDbmsSupport dbmsSupport, ResultSet rs, int maxRows, boolean includeFieldDefinition) voidgetXML(IDbmsSupport dbmsSupport, ResultSet rs, int maxRows, boolean includeFieldDefinition, ContentHandler handler, boolean prettyPrint) booleanbooleanbooleanvoidsetBlobCharset(String string) voidsetDecompressBlobs(boolean b) voidvoidsetGetBlobSmart(boolean b) voidSet the presentation of aNullvaluevoidvoidsetTrimSpaces(boolean b)
-
Field Details
-
log
protected static org.apache.logging.log4j.Logger log
-
-
Constructor Details
-
DB2XMLWriter
public DB2XMLWriter()
-
-
Method Details
-
getFieldType
-
getXML
Retrieve the Resultset as a well-formed XML string -
getXML
Retrieve the Resultset as a well-formed XML string -
getXML
public String getXML(@Nonnull IDbmsSupport dbmsSupport, @Nullable ResultSet rs, int maxRows, boolean includeFieldDefinition) -
getXML
public void getXML(@Nonnull IDbmsSupport dbmsSupport, @Nullable ResultSet rs, int maxRows, boolean includeFieldDefinition, ContentHandler handler, boolean prettyPrint) throws SAXException - Throws:
SAXException
-
getXML
public String getXML(@Nonnull IDbmsSupport dbmsSupport, @Nonnull CallableStatement callableStatement, boolean alsoGetResultSets, @Nonnull Map<Integer, IParameter> outputParameters, int maxRows, boolean includeFieldDefinition) -
getXML
public void getXML(@Nonnull IDbmsSupport dbmsSupport, @Nonnull CallableStatement callableStatement, boolean alsoGetResultSets, @Nonnull Map<Integer, IParameter> outputParameters, int maxRows, boolean includeFieldDefinition, @Nonnull ContentHandler handler, boolean prettyPrint) throws SAXException- Throws:
SAXException
-
addFieldDefinitions
public static void addFieldDefinitions(SaxElementBuilder root, ResultSetMetaData rsmeta) throws SAXException, SQLException - Throws:
SAXExceptionSQLException
-
getRowXml
public static String getRowXml(IDbmsSupport dbmsSupport, ResultSet rs, int rowNumber, ResultSetMetaData rsmeta, String blobCharset, boolean decompressBlobs, String nullValue, boolean trimSpaces, boolean getBlobSmart) throws SenderException, SQLException, SAXException - Throws:
SenderExceptionSQLExceptionSAXException
-
getRowXml
public static void getRowXml(SaxElementBuilder rows, IDbmsSupport dbmsSupport, ResultSet rs, int rowNumber, ResultSetMetaData rsmeta, String blobCharset, boolean decompressBlobs, String nullValue, boolean trimSpaces, boolean getBlobSmart) throws SenderException, SQLException, SAXException - Throws:
SenderExceptionSQLExceptionSAXException
-
setDocumentName
-
setRecordName
-
setNullValue
Set the presentation of aNullvalue -
getNullValue
Get the presentation of aNullvalue -
setTrimSpaces
public void setTrimSpaces(boolean b) -
isTrimSpaces
public boolean isTrimSpaces() -
setDecompressBlobs
public void setDecompressBlobs(boolean b) -
isDecompressBlobs
public boolean isDecompressBlobs() -
setGetBlobSmart
public void setGetBlobSmart(boolean b) -
isGetBlobSmart
public boolean isGetBlobSmart() -
getBlobCharset
-
setBlobCharset
-