Class JdbcThinTcpIo


  • public class JdbcThinTcpIo
    extends Object
    JDBC IO layer implementation based on blocking IPC streams.
    • Constructor Detail

      • JdbcThinTcpIo

        public JdbcThinTcpIo​(ConnectionProperties connProps,
                             InetSocketAddress sockAddr,
                             BinaryContext ctx,
                             int timeout)
                      throws SQLException,
                             IOException
        Start connection and perform handshake.
        Parameters:
        connProps - Connection properties.
        sockAddr - Socket address.
        ctx - Binary context for proper serialization/deserialization of binary objects.
        timeout - Socket connection timeout in ms.
        Throws:
        SQLException - On connection error or reject.
        IOException - On IO error in handshake.
    • Method Detail

      • close

        public void close()
        Close the client IO.
      • connectionProperties

        public ConnectionProperties connectionProperties()
        Returns:
        Connection properties.
      • timeout

        public void timeout​(int ms)
                     throws SQLException
        Enable/disable socket timeout with specified timeout.
        Parameters:
        ms - the specified timeout, in milliseconds.
        Throws:
        SQLException - if there is an error in the underlying protocol.
      • timeout

        public int timeout()
                    throws SQLException
        Returns socket timeout.
        Throws:
        SQLException - if there is an error in the underlying protocol.
      • nodeId

        public UUID nodeId()
        Returns:
        Node Id.
      • connected

        public boolean connected()
        Returns:
        Connected flag.