uk.org.ogsadai.client.toolkit.activity.sql
Class ResultSetActivityOutputConverter
java.lang.Object
|
+--uk.org.ogsadai.client.toolkit.activity.sql.ResultSetActivityOutputConverter
- public class ResultSetActivityOutputConverter
- extends java.lang.Object
Converts XML WebRowSet from an SQL activity or CSV data into a java.sql.ResultSet
.
- Author:
- The OGSA-DAI Project Team
Field Summary |
private static java.lang.String |
COPYRIGHT_NOTICE
Copyright statement |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
COPYRIGHT_NOTICE
private static final java.lang.String COPYRIGHT_NOTICE
-
Copyright statement
- See Also:
- Constant Field Values
ResultSetActivityOutputConverter
public ResultSetActivityOutputConverter()
convert
public static java.sql.ResultSet convert(ActivityOutput output)
throws NoActivityOutputException,
DataFormatException
-
Converts an activity output to a forward-only
java.sql.ResultSet
. The activity output must be an XML WebRowSet representation of a relational database query result.
-
- Parameters:
output
- Output with the data to convert
- Returns:
- forward-only
ResultSet
representing the query result that is in the give activity output.
- Throws:
NoActivityOutputException
- if there is no output data or the data has not yet been processed to this output or the activity that generates this output has not yet been executed.
DataFormatException
- if the output from the activity cannot be parsed into a ResultSet
.
convert
public static java.sql.ResultSet convert(ActivityOutput output,
int resultSetType)
throws NoActivityOutputException,
DataFormatException
-
Converts an activity output to a
java.sql.ResultSet
. The activity output must be an XML WebRowSet representation of a relational database query result.
-
- Parameters:
output
- Output with the data to convert
resultSetType
- One of ResultSet.TYPE_FORWARD_ONLY
or ResultSet.TYPE_SCROLL_INSENSITIVE
.
- Returns:
ResultSet
of the requested type representing the query result that is in the give activity output.
- Throws:
java.lang.IllegalArgumentException
- if resultSetType
is not one of the two above.
NoActivityOutputException
- if there is no output data or the data has not yet been processed to this output or the activity that generates this output has not yet been executed.
DataFormatException
- if the output from the activity cannot be parsed into a ResultSet
.
convertFromCSV
public static java.sql.ResultSet convertFromCSV(ActivityOutput output)
throws NoActivityOutputException,
DataFormatException
-
Converts an activity output to a forward-only
java.sql.ResultSet
. The activity output must be a CSV representation of a relational database query result. This method assumes default CSV file format (delimiter=, lineBreak=CRLF nullDataStr=NULL).
-
- Parameters:
output
- Output with the data to convert
- Returns:
- forward-only
ResultSet
representing the query result that is in the give activity output.
- Throws:
NoActivityOutputException
- if there is no output data or the data has not yet been processed to this output or the activity that generates this output has not yet been executed.
DataFormatException
- if the output from the activity cannot be parsed into a ResultSet
.
convertFromCSV
public static java.sql.ResultSet convertFromCSV(ActivityOutput output,
int resultSetType)
throws NoActivityOutputException,
DataFormatException
-
Converts an activity output to a
java.sql.ResultSet
. The activity output must be a CSV representation of a database query result. This method assumes default CSV file format (delimiter=, lineBreak=CRLF nullDataStr=NULL).
-
- Parameters:
output
- Output with the data to convert
resultSetType
- One of ResultSet.TYPE_FORWARD_ONLY
or ResultSet.TYPE_SCROLL_INSENSITIVE
.
- Returns:
ResultSet
of the requested type representing the query result that is in the give activity output.
- Throws:
java.lang.IllegalArgumentException
- if resultSetType
is not one of the two above.
NoActivityOutputException
- if there is no output data or the data has not yet been processed to this output or the activity that generates this output has not yet been executed.
DataFormatException
- if the output from the activity cannot be parsed into a ResultSet
.
convertFromCSV
public static java.sql.ResultSet convertFromCSV(ActivityOutput output,
int resultSetType,
CSVConfigurator configurator)
throws NoActivityOutputException,
DataFormatException
-
Converts an activity output to a
java.sql.ResultSet
. The activity output must be a CSV representation of a database query result. This method assumes default CSV file format (delimiter=, lineBreak=CRLF nullDataStr=NULL).
-
- Parameters:
output
- Output with the data to convert
resultSetType
- One of ResultSet.TYPE_FORWARD_ONLY
or ResultSet.TYPE_SCROLL_INSENSITIVE
.
configurator
- Description of the CSV format.
- Returns:
ResultSet
of the requested type representing the query result that is in the give activity output.
- Throws:
java.lang.IllegalArgumentException
- if resultSetType
is not one of the two above.
NoActivityOutputException
- if there is no output data or the data has not yet been processed to this output or the activity that generates this output has not yet been executed.
DataFormatException
- if the output from the activity cannot be parsed into a ResultSet
.