Package uk.ac.starlink.ttools.example
Class TapWriter
- java.lang.Object
-
- uk.ac.starlink.ttools.example.TapWriter
-
public class TapWriter extends java.lang.ObjectWrites 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
Constructors Constructor Description TapWriter(uk.ac.starlink.votable.DataFormat dfmt, uk.ac.starlink.votable.VOTableVersion version, long maxrec)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidmain(java.lang.String[] args)Test harness.voidwriteVOTable(java.sql.ResultSet rset, java.io.OutputStream ostrm)Writes a result set to an output stream as a VOTable.
-
-
-
Constructor Detail
-
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 Detail
-
writeVOTable
public void writeVOTable(java.sql.ResultSet rset, java.io.OutputStream ostrm) throws java.io.IOException, java.sql.SQLExceptionWrites a result set to an output stream as a VOTable.- Parameters:
rset- result setostrm- destination stream- Throws:
java.io.IOExceptionjava.sql.SQLException
-
main
public static void main(java.lang.String[] args) throws java.io.IOException, java.sql.SQLExceptionTest 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:
java.io.IOExceptionjava.sql.SQLException
-
-