uk.ac.starlink.ttools.example
Class TapWriter

java.lang.Object
  extended by uk.ac.starlink.ttools.example.TapWriter

public class TapWriter
extends Object

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
TapWriter(DataFormat dfmt, VOTableVersion version, long maxrec)
          Constructor.
 
Method Summary
static void main(String[] args)
          Test harness.
 void writeVOTable(ResultSet rset, OutputStream ostrm)
          Writes a result set to an output stream as a VOTable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TapWriter

public TapWriter(DataFormat dfmt,
                 VOTableVersion version,
                 long maxrec)
Constructor.

Parameters:
dfmt - selects VOTable serialization format (TABLEDATA, BINARY, BINARY2, FITS)
version - selects VOTable version
maxrec - maximum record count before overflow; negative value means no limit
Method Detail

writeVOTable

public void writeVOTable(ResultSet rset,
                         OutputStream ostrm)
                  throws IOException,
                         SQLException
Writes a result set to an output stream as a VOTable.

Parameters:
rset - result set
ostrm - destination stream
Throws:
IOException
SQLException

main

public static void main(String[] args)
                 throws IOException,
                        SQLException
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:
IOException
SQLException


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.