code: public void close() {
      if (lock != null) {
        lock.lock();
      }
      this.connected = false;
      try {
        /* If a streaming result set is open, close it.*/
        skip();
      } catch (Exception e) {
        /* eat exception */
      }
  
      SendClosePacket.send(writer);
      closeSocket(reader, writer, socket);
      cleanMemory();
      if (lock != null) {
        lock.unlock();
      }
    }
docs: Closes socket and stream readers/writers Attempts graceful shutdown.