Initializes a new instance of the DataSet class with data taken from Connection. Tables, Relations, Constraints and Indexes will be copied into DataSet.
By default no schema name will be used.
Parameters:
Parameter
Type
Description
connection
java.sql.Connection
which contains DB data.
DataSet(Connection connection, String schemaName)
public DataSet(Connection connection, String schemaName)
Initializes a new instance of the DataSet class with data taken from Connection. Tables, Relations, Constraints and Indexes will be copied into DataSet.
DataSet dataSet = new DataSet(conn, "PUBLIC"); // HSQLDB
or
DataSet dataSet = new DataSet(conn); // MYSQL's default schema name.
Parameters:
Parameter
Type
Description
connection
java.sql.Connection
which contains DB data.
schemaName
java.lang.String
which contains the tables to be imported.
DataSet(String dataSetName)
public DataSet(String dataSetName)
Initializes a new instance of a DataSet class with the given name.
Returns:XmlReadMode - The XmlReadMode used to read the data.
readXml(InputStream xmlStream)
public XmlReadMode readXml(InputStream xmlStream)
Reads XML schema and data into the DataSet using the specified java.io.InputStream. The #readXml(InputStream, XmlReadMode).readXml(InputStream, XmlReadMode) method provides a way to read either data only, or both data and schema into a DataSet from an XML document, whereas the #readXmlSchema(InputStream).readXmlSchema(InputStream) method reads only the schema. To read both data and schema, use one of the readXML overloads that includes the mode parameter, and set its value to ReadSchema. If an in-line schema is specified, the in-line schema is used to extend the existing relational structure prior to loading the data. If there are any conflicts (for example, the same column in the same table defined with different data types) an exception is raised.
Parameters:
Parameter
Type
Description
xmlStream
java.io.InputStream
data stream
Returns:XmlReadMode - mode which was used while reading
readXml(String fileName)
public XmlReadMode readXml(String fileName)
Reads XML schema and data into the DataSet using the specified file.
Parameters:
Parameter
Type
Description
fileName
java.lang.String
The filename (including the path) from which to read.
Returns:XmlReadMode - The XmlReadMode used to read the data. The returned value is one of XmlReadMode constants.
readXml(String xmlPath, XmlReadMode readMode)
public XmlReadMode readXml(String xmlPath, XmlReadMode readMode)
Reads XML schema and data into the DataSet using the specified file and XmlReadMode.