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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addFieldDefinitions
(SaxElementBuilder root, ResultSetMetaData rsmeta) static String
getFieldType
(int type) Get the presentation of aNull
valuestatic String
getRowXml
(IDbmsSupport dbmsSupport, ResultSet rs, int rowNumber, ResultSetMetaData rsmeta, String blobCharset, boolean decompressBlobs, String nullValue, boolean trimSpaces, boolean getBlobSmart) static void
getRowXml
(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) void
getXML
(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) void
getXML
(IDbmsSupport dbmsSupport, ResultSet rs, int maxRows, boolean includeFieldDefinition, ContentHandler handler, boolean prettyPrint) boolean
boolean
boolean
void
setBlobCharset
(String string) void
setDecompressBlobs
(boolean b) void
void
setGetBlobSmart
(boolean b) void
Set the presentation of aNull
valuevoid
void
setTrimSpaces
(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:
SAXException
SQLException
-
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:
SenderException
SQLException
SAXException
-
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:
SenderException
SQLException
SAXException
-
setDocumentName
-
setRecordName
-
setNullValue
Set the presentation of aNull
value -
getNullValue
Get the presentation of aNull
value -
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
-