SharedSocket(String host, int port, int tdsVersion, int serverType, boolean tcpNoDelay, int timeout) throws IOException, UnknownHostException { setTdsVersion(tdsVersion); setServerType(serverType); this.host = host; this.port = port; if (Driver.JDBC3) { try {  Constructor constructor = Socket.class.getConstructor(new Class[] {}); this.socket = (Socket) constructor.newInstance(new Object[] {});   constructor = Class.forName("java.net.InetSocketAddress") .getConstructor(new Class[] {String.class, int.class}); Object address = constructor.newInstance( new Object[] {host, new Integer(port)});   Method connect = Socket.class.getMethod("connect", new Class[] {Class.forName("java.net.SocketAddress"), int.class}); connect.invoke(this.socket, new Object[] {address, new Integer(timeout)}); } catch (Exception ex) { throw new IOException("Could not create socket: " + ex); } } else { this.socket = new Socket(host, port); } setOut(new DataOutputStream(socket.getOutputStream())); setIn(new DataInputStream(socket.getInputStream())); this.socket.setTcpNoDelay(tcpNoDelay);
protected SharedSocket() {
    SharedSocket(String host, int port, int tdsVersion, int serverType,    		boolean tcpNoDelay, int timeout)            throws IOException, UnknownHostException {        setTdsVersion(tdsVersion);        setServerType(serverType);        this.host = host;        this.port = port;        if (Driver.JDBC3) {            try {                // Create the Socket                Constructor constructor =                        Socket.class.getConstructor(new Class[] {});                this.socket =                        (Socket) constructor.newInstance(new Object[] {});                // Create the InetSocketAddress                constructor = Class.forName("java.net.InetSocketAddress")                        .getConstructor(new Class[] {String.class, int.class});                Object address = constructor.newInstance(                                new Object[] {host, new Integer(port)});                // Call Socket.connect(InetSocketAddress, int)                Method connect = Socket.class.getMethod("connect", new Class[]                        {Class.forName("java.net.SocketAddress"), int.class});                connect.invoke(this.socket,                        new Object[] {address, new Integer(timeout)});            } catch (Exception ex) {                throw new IOException("Could not create socket: " + ex);            }        } else {            this.socket = new Socket(host, port);        }        setOut(new DataOutputStream(socket.getOutputStream()));        setIn(new DataInputStream(socket.getInputStream()));        this.socket.setTcpNoDelay(tcpNoDelay);    }