use of org.apache.ignite.internal.jdbc.thin.ConnectionPropertiesImpl in project ignite by apache.
the class IgniteJdbcThinDriver method connect.
/**
* {@inheritDoc}
*/
@Override
public Connection connect(String url, Properties props) throws SQLException {
if (!acceptsURL(url))
return null;
ConnectionPropertiesImpl connProps = new ConnectionPropertiesImpl();
connProps.init(url, props);
return new JdbcThinConnection(connProps);
}
use of org.apache.ignite.internal.jdbc.thin.ConnectionPropertiesImpl in project ignite by apache.
the class JdbcThinTcpIoTest method createTcpIo.
/**
* Create JdbcThinTcpIo instance.
*
* @param addrs IP-addresses.
* @param port Server socket port.
* @return JdbcThinTcpIo instance.
* @throws SQLException On connection error or reject.
*/
private JdbcThinTcpIo createTcpIo(String[] addrs, int port) throws SQLException {
ConnectionPropertiesImpl connProps = new ConnectionPropertiesImpl();
connProps.setAddresses(new HostAndPortRange[] { new HostAndPortRange("test.domain.name", port, port) });
return new JdbcThinTcpIo(connProps) {
@Override
protected InetAddress[] getAllAddressesByHost(String host) throws UnknownHostException {
InetAddress[] addresses = new InetAddress[addrs.length];
for (int i = 0; i < addrs.length; i++) addresses[i] = InetAddress.getByName(addrs[i]);
return addresses;
}
@Override
public void handshake(ClientListenerProtocolVersion ver) {
// Skip handshake.
}
};
}
use of org.apache.ignite.internal.jdbc.thin.ConnectionPropertiesImpl in project ignite by apache.
the class IgniteJdbcThinDriver method getPropertyInfo.
/**
* {@inheritDoc}
*/
@Override
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
ConnectionPropertiesImpl connProps = new ConnectionPropertiesImpl();
connProps.init(url, info);
return connProps.getDriverPropertyInfo();
}
Aggregations