org.restlet.ext.jdbc
Class RowSetRepresentation

java.lang.Object
  extended by org.restlet.representation.Variant
      extended by org.restlet.representation.RepresentationInfo
          extended by org.restlet.representation.Representation
              extended by org.restlet.representation.CharacterRepresentation
                  extended by org.restlet.representation.WriterRepresentation
                      extended by org.restlet.ext.jdbc.RowSetRepresentation

public class RowSetRepresentation
extends WriterRepresentation

XML Representation of a ResultSet instance wrapped either in a JdbcResult instance or in a WebRowSet. Leverage the WebRowSet API to create the Response entity.
Give access to the JdbcResult instance and to the WebRowSet for retrieval of the connected ResultSet in the same JVM (for advanced use cases).

Author:
Thierry Boileau, Jerome Louvel
See Also:
WebRowSet

Field Summary
 
Fields inherited from class org.restlet.representation.Representation
UNKNOWN_SIZE
 
Constructor Summary
RowSetRepresentation(JdbcResult jdbcResult)
          Constructor.
RowSetRepresentation(JdbcResult jdbcResult, int start, int limit)
          Constructor with paging.
RowSetRepresentation(ResultSet resultSet)
          Constructor.
RowSetRepresentation(ResultSet resultSet, int start, int limit)
          Constructor with paging.
RowSetRepresentation(WebRowSet webRowSet)
          Constructor.
 
Method Summary
 JdbcResult getJdbcResult()
          Returns the inner JdbcResult instance or null.
 WebRowSet getWebRowSet()
          Returns the inner WebRowSet instance.
 void write(Writer writer)
           
 
Methods inherited from class org.restlet.representation.WriterRepresentation
getReader
 
Methods inherited from class org.restlet.representation.CharacterRepresentation
getChannel, getStream, write, write
 
Methods inherited from class org.restlet.representation.Representation
append, exhaust, getAvailableSize, getDigest, getDisposition, getExpirationDate, getRange, getRegistration, getSize, getText, hasKnownSize, isAvailable, isEmpty, isSelectable, isTransient, release, setAvailable, setDigest, setDisposition, setExpirationDate, setListener, setRange, setSize, setTransient
 
Methods inherited from class org.restlet.representation.RepresentationInfo
getModificationDate, getTag, setModificationDate, setTag
 
Methods inherited from class org.restlet.representation.Variant
createClientInfo, equals, getCharacterSet, getEncodings, getLanguages, getLocationRef, getMediaType, includes, isCompatible, setCharacterSet, setEncodings, setLanguages, setLocationRef, setLocationRef, setMediaType, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RowSetRepresentation

public RowSetRepresentation(JdbcResult jdbcResult)
                     throws SQLException
Constructor.

Parameters:
jdbcResult - The inner JdbcResult.
Throws:
SQLException

RowSetRepresentation

public RowSetRepresentation(JdbcResult jdbcResult,
                            int start,
                            int limit)
                     throws SQLException
Constructor with paging.

Parameters:
jdbcResult - The inner JdbcResult.
start - The start index of the page or 0 for the first result.
limit - The page size or -1 if no limit is set.
Throws:
SQLException

RowSetRepresentation

public RowSetRepresentation(ResultSet resultSet)
                     throws SQLException
Constructor.

Parameters:
resultSet - The result set to use to populate the Web row set.
Throws:
SQLException

RowSetRepresentation

public RowSetRepresentation(ResultSet resultSet,
                            int start,
                            int limit)
                     throws SQLException
Constructor with paging.

Parameters:
resultSet - The result set to use to populate the Web row set.
start - The start index of the page or 1 for the first result.
limit - The page size or -1 if no limit is set.
Throws:
SQLException

RowSetRepresentation

public RowSetRepresentation(WebRowSet webRowSet)
Constructor.

Parameters:
webRowSet - The inner WebRowSet.
Method Detail

getJdbcResult

public JdbcResult getJdbcResult()
Returns the inner JdbcResult instance or null.

Returns:
The inner JdbcResult instance or null.

getWebRowSet

public WebRowSet getWebRowSet()
Returns the inner WebRowSet instance.

Returns:
The inner WebRowSet instance.

write

public void write(Writer writer)
           throws IOException
Specified by:
write in class Representation
Throws:
IOException


Copyright © 2005-2013 Restlet.