public final class ConnectionHelper extends Object
| Constructor and Description |
|---|
ConnectionHelper() |
| Modifier and Type | Method and Description |
|---|---|
static void |
authenticationHandler(Credential credential,
Writer writer,
Reader reader,
com.singlestore.jdbc.client.Context context)
Authentication swtich handler
|
static Socket |
connectSocket(Configuration conf,
HostAddress hostAddress)
Connect socket
|
static Socket |
createSocket(Configuration conf,
HostAddress hostAddress)
Create socket accordingly to options.
|
static long |
initializeClientCapabilities(Configuration configuration,
long serverCapabilities,
HostAddress hostAddress)
Initialize client capability according to configuration and server capabilities.
|
static Credential |
loadCredential(CredentialPlugin credentialPlugin,
Configuration configuration,
HostAddress hostAddress)
Load user/password plugin if configured to.
|
static SSLSocket |
sslWrapper(HostAddress hostAddress,
Socket socket,
long clientCapabilities,
byte exchangeCharset,
com.singlestore.jdbc.client.Context context,
Writer writer)
Create SSL wrapper
|
static Socket |
standardSocket(Configuration conf,
HostAddress hostAddress)
Use standard socket implementation.
|
public static Socket createSocket(Configuration conf, HostAddress hostAddress) throws IOException, SQLException
conf - Url optionshostAddress - host ( mandatory but for named pipe / unix socket)IOException - if connection error occurSQLException - in case of configuration errorpublic static Socket standardSocket(Configuration conf, HostAddress hostAddress) throws IOException, SQLException
conf - url optionshostAddress - host to connectIOException - in case of error establishing socket.SQLException - in case host is nullpublic static Socket connectSocket(Configuration conf, HostAddress hostAddress) throws SQLException
conf - configurationhostAddress - host to connectSQLException - if hostname is required and not provided, or socket cannot be createdpublic static long initializeClientCapabilities(Configuration configuration, long serverCapabilities, HostAddress hostAddress)
configuration - configurationserverCapabilities - server capabilitieshostAddress - host address serverpublic static void authenticationHandler(Credential credential, Writer writer, Reader reader, com.singlestore.jdbc.client.Context context) throws SQLException, IOException
credential - credentialwriter - socket writerreader - socket readercontext - connection contextIOException - if any socket error occursSQLException - if any other kind of issue occurspublic static Credential loadCredential(CredentialPlugin credentialPlugin, Configuration configuration, HostAddress hostAddress) throws SQLException
credentialPlugin - configuration credential pluginconfiguration - configurationhostAddress - current connection host addressSQLException - if configured credential plugin failpublic static SSLSocket sslWrapper(HostAddress hostAddress, Socket socket, long clientCapabilities, byte exchangeCharset, com.singlestore.jdbc.client.Context context, Writer writer) throws SQLException, IOException
hostAddress - hostsocket - socketclientCapabilities - client capabilitiesexchangeCharset - connection charsetcontext - connection contextwriter - socket writerIOException - if any socket error occursSQLException - for any other kind of errorCopyright © 2025 SingleStore. All rights reserved.