Class TapWriter


  • public class TapWriter
    extends java.lang.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

      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 void main​(java.lang.String[] args)
      Test harness.
      void writeVOTable​(java.sql.ResultSet rset, java.io.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​(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 version
        maxrec - 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.SQLException
        Writes a result set to an output stream as a VOTable.
        Parameters:
        rset - result set
        ostrm - destination stream
        Throws:
        java.io.IOException
        java.sql.SQLException
      • main

        public static void main​(java.lang.String[] args)
                         throws java.io.IOException,
                                java.sql.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:
        java.io.IOException
        java.sql.SQLException