Retrieve data

You can use the methods in this section to convert XML data that has been fetched from a database column. These methods help you either convert selected XML text to DOM or parse the data with SAX. The InputSource class is the input type to JAXP parsing methods.

For information about the file, handler, nsa, and validating parameters, see Insert data.

The following methods convert objects of type String or InputStream to objects of type InputSource. You can use the ResultSet.getString(), ResultSet.getAsciiStream(), or ResultSet.getBinaryInputStream() methods to retrieve the data from the database column and then pass the retrieved data to getInputSource() for use with any of the SAX or DOM parsing methods. (For an example, see Retrieve data examples.)
public InputSource getInputSource(String s) throws SQLException;

public InputSource getInputSource(InputStream is) throws
   SQLException;
The following methods convert objects of type String or InputStream to objects of type Document:
public Document StringtoDOM(String s, String handler, boolean
   validating,boolean nsa) throws SQLException

public Document StringtoDOM(String s, String handler) throws
   SQLException

public Document StringtoDOM(String s) throws SQLException

public Document InputStreamtoDOM(String s, String handler, boolean
   validating,boolean nsa) throws SQLException

public Document InputStreamtoDOM(String file, String handler)
   throws SQLException

public Document InputStreamtoDOM(String file) throws SQLException

For examples of using these methods, see Retrieve data examples.