Class TapWriter
java.lang.Object
uk.ac.starlink.ttools.example.TapWriter
Writes SQL ResultSets to VOTable with the INFO elements appropriate
for TAP output.
It's all streamed, so no appreciable amount of memory should be required,
and a maximum record count can be imposed.
- Since:
- 5 Feb 2013
- Author:
- Mark Taylor
-
Constructor Summary
ConstructorsConstructorDescriptionTapWriter(uk.ac.starlink.votable.DataFormat dfmt, uk.ac.starlink.votable.VOTableVersion version, long maxrec) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidTest harness.voidwriteVOTable(ResultSet rset, OutputStream ostrm) Writes a result set to an output stream as a VOTable.
-
Constructor Details
-
TapWriter
public TapWriter(uk.ac.starlink.votable.DataFormat dfmt, uk.ac.starlink.votable.VOTableVersion version, long maxrec) Constructor.- Parameters:
dfmt- selects VOTable serialization format (TABLEDATA, BINARY, BINARY2, FITS)version- selects VOTable versionmaxrec- maximum record count before overflow; negative value means no limit
-
-
Method Details
-
writeVOTable
Writes a result set to an output stream as a VOTable.- Parameters:
rset- result setostrm- destination stream- Throws:
IOExceptionSQLException
-
main
Test harness. Run with -help for usage. Don't forget to put a JDBC driver on the classpath and set the system property jdbc.drivers.- Throws:
IOExceptionSQLException
-