SqlRemoteConnection implements ISqlConnection and provides remote SQL access to an xSQL server or a distributed SQL deployment.
public class SqlRemoteConnection : ISqlConnection, IDisposable {
public enum ReplicationType { SQLReplication, HAReplication }
public class OpenParameters {
public String host;
public int port;
public String[] nodes;
public int nReplicas;
public ReplicationType replType;
public int maxAttempts;
public int txBufSize;
public int connectTimeout;
public int readTimeout;
public bool localDomain;
public int compressionLevel;
public Database.SSLParameters sslParameters;
public String user;
public String password;
public OpenParameters();
}
public SqlRemoteConnection(Database db, string host, int port, int maxAttempts);
public SqlRemoteConnection(Database db, string host, int port, int maxAttempts, int txBufSize);
public SqlRemoteConnection(Database db, string[] nodes);
public SqlRemoteConnection(Database db, string[] nodes, int nReplicas, ReplicationType replType, int maxAttempts, int txBufSize);
public SqlRemoteConnection(Database db, OpenParameters parameters);
public IDatabaseWrapper Wrapper { get; }
public SqlResultSet ExecuteQuery(String query, params Object[] args);
public int ExecuteStatement(String stmt, params Object[] args);
public void Disconnect();
public void Dispose();
public void DetachResultSet(SqlResultSet res);
}
SQLReplication for standard distributed SQL access and HAReplication for HA-aware distributed access.host and port for a single remote SQL server, or nodes for a distributed connection where each element has the form HOST:PORT.nReplicas = 1, replType = SQLReplication, maxAttempts = 10, txBufSize = 64*1024, connectTimeout = 2000, readTimeout = 1200*1000, compressionLevel = 0, and localDomain = false.localDomain requests local-domain transport where supported by the runtime. sslParameters, user, and password configure secure and authenticated remote access.OpenParameters object. This overload supports both single-node and distributed configurations. At least one of host or nodes must be specified; otherwise the constructor throws DatabaseError.SQLReplication, ten connection attempts, and a 64 KB transmit buffer.HOST:PORT. This overload is used when the application needs to control redundancy level, replication mode, retry count, and transmit buffer size.IDatabaseWrapper used for low-level remote SQL operations.SqlException if the connection has already been closed.SqlException if the connection has already been closed.Disconnect() on an already closed connection has no effect.Disconnect().SqlResultSet to clear the currently attached result from the remote connection.SqlResultSet. Executing another query or disconnecting the connection automatically disposes the previous result set.params Object[] and bound to ? placeholders by position.defaultStringEncoding and converted to the wire format expected by the remote SQL engine.OpenParameters.SSLParameters and credentials before creating the connection. Applications typically initialize SSL support on the owning Database object before opening SSL-protected remote connections.