SqlInputSource.java

/*
* SqlInputSource.java
*
* Created on April 29, 2007, 5:24 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/

package com.arpu.opencds.datatransformation;

import java.sql.ResultSet;
import org.xml.sax.InputSource;

/**
* a class that extends InputSource.
* The intent of this class is to just holds a copy of the ResultSet object
* for the XML reader to use it.
* @author aabdelaziz
* http://www.aliabdelaziz.org/
*/
public class SqlInputSource extends InputSource {

/**
* Zero-argument default constructor.
*
* @see #setPublicId
* @see #setSystemId
* @see #setByteStream
* @see #setCharacterStream
* @see #setEncoding
* @see #setResultSet
*/
public SqlInputSource() {
super();
}

/**
* Create a new sql input source with a system identifier.
*
*

Applications may use setResultSet to include a
* public identifier as well.

*
*

...
* ... .

*
* @param resultSet The Result Set.
* @see #setResultSet
*/
public SqlInputSource (ResultSet resultSet)
{
setResultSet(resultSet);
}

/**
* Set the result set for this input source.
*
*

The SAX parser will ignore this if there is also a character
* stream specified, but it will use a byte stream in preference
* to opening a URI connection itself.

*
*

If the application knows the character resultSet of the
* ... , it should set it with the setEncoding method.

*
* @param resultSet A ResultSet containing an SQL resultSet query
* @see #getResultSet
* @see java.io.InputStream
*/
public void setResultSet (ResultSet resultSet)
{
this.resultSet = resultSet;
}

/**
* Get the Result Set for this sql input source.
*
*

The getEncoding method will return the character
* encoding for this byte stream, or null if unknown.

*
* @return The resultSet, or null if none was supplied.
* @see #setResultSet
*/
public ResultSet getResultSet() {
return resultSet;
}

////////////////////////////////////////////////////////////////////
// Internal state.
////////////////////////////////////////////////////////////////////

private ResultSet resultSet;
}

This is a timely information

This is a timely information for me. I'll be using this resource in my incoming projects. - Dennis Wong YOR Health

Powered by Drupal - Design by artinet