Class MsXmlReader
java.lang.Object
org.pgcodekeeper.core.database.ms.jdbc.MsXmlReader
XML reader for parsing Microsoft SQL Server XML query results.
Provides typed access to XML attributes converted from database query results.
-
Method Summary
Modifier and TypeMethodDescriptionbooleangetBoolean(String columnName) Returns the boolean value for the specified column name.doubleReturns the double value for the specified column name.floatReturns the float value for the specified column name.intReturns the integer value for the specified column name.longReturns the long value for the specified column name.shortReturns the short value for the specified column name.Returns the string value for the specified column name.static List<MsXmlReader>Parses XML string into a list of XmlReader instances.
-
Method Details
-
getDouble
Returns the double value for the specified column name.- Parameters:
columnName- the column name- Returns:
- the double value, or 0 if null
-
getLong
Returns the long value for the specified column name.- Parameters:
columnName- the column name- Returns:
- the long value, or 0 if null
-
getBoolean
Returns the boolean value for the specified column name. Returns true if the value equals "1".- Parameters:
columnName- the column name- Returns:
- true if the value is "1", false otherwise
-
getString
Returns the string value for the specified column name.- Parameters:
columnName- the column name- Returns:
- the string value, or null if not found
-
getFloat
Returns the float value for the specified column name.- Parameters:
columnName- the column name- Returns:
- the float value, or 0 if null
-
getInt
Returns the integer value for the specified column name.- Parameters:
columnName- the column name- Returns:
- the integer value, or 0 if null
-
getShort
Returns the short value for the specified column name.- Parameters:
columnName- the column name- Returns:
- the short value, or 0 if null
-
readXML
Parses XML string into a list of XmlReader instances. Each child element of the root becomes an XmlReader with its attributes as accessible data.- Parameters:
xml- the XML string to parse- Returns:
- list of XmlReader instances, one for each child element
- Throws:
XmlReaderException- if XML parsing fails
-