Top Description Methods
com.mysql.jdbc

public Interface SocketFactory

Annotations
@Deprecated
Imports
java.io.IOException, java.net.Socket, .SocketException, java.util.Properties

Deprecated

Use com.mysql.cj.protocol.SocketFactory instead.

Interface to allow pluggable socket creation in the driver

Method Summary

Modifier and TypeMethod and Description
public Socket

Returns:

the socket to use after the handshake
afterHandshake
()

Called by the driver after issuing the MySQL protocol handshake and reading the results of the handshake.

public Socket

Returns:

the socket to use before the handshake
beforeHandshake
()

Called by the driver before issuing the MySQL protocol handshake.

public Socket

Returns:

a socket connected to the given host
connect
(String
the hostname passed in the JDBC URL. It will be a single hostname, as the driver parses multi-hosts (for failover) and calls this method for each host connection attempt.
host
,
int
the port number to connect to (if required).
portNumber
,
Properties
properties passed to the driver via the URL and/or properties instance.
props
)

Creates a new socket using the given properties.

Method Detail

afterHandshakeback to summary
public Socket afterHandshake() throws SocketException, IOException

Called by the driver after issuing the MySQL protocol handshake and reading the results of the handshake.

Returns:Socket

the socket to use after the handshake

Exceptions
SocketException:
if a socket error occurs
IOException:
if an I/O error occurs
beforeHandshakeback to summary
public Socket beforeHandshake() throws SocketException, IOException

Called by the driver before issuing the MySQL protocol handshake. Should return the socket instance that should be used during the handshake.

Returns:Socket

the socket to use before the handshake

Exceptions
SocketException:
if a socket error occurs
IOException:
if an I/O error occurs
connectback to summary
public Socket connect(String host, int portNumber, Properties props) throws SocketException, IOException

Creates a new socket using the given properties. Properties are parsed by the driver from the URL. All properties other than sensitive ones (user and password) are passed to this method. The driver will instantiate the socket factory with the class name given in the property "socketFactory", where the standard is com.mysql.jdbc.StandardSocketFactory Implementing classes are responsible for handling synchronization of this method (if needed).

Parameters
host:String

the hostname passed in the JDBC URL. It will be a single hostname, as the driver parses multi-hosts (for failover) and calls this method for each host connection attempt.

portNumber:int

the port number to connect to (if required).

props:Properties

properties passed to the driver via the URL and/or properties instance.

Returns:Socket

a socket connected to the given host

Exceptions
SocketException:
if a socket error occurs
IOException:
if an I/O error occurs