/** * Test max open cursors per connection. * * @throws Exception If failed. */ @Test public void testMaxOpenCusrorsPerConnection() throws Exception { check(new ClientConnectorConfiguration().setMaxOpenCursorsPerConnection(-1), false); check(new ClientConnectorConfiguration().setMaxOpenCursorsPerConnection(0), true); checkJdbc(null, ClientConnectorConfiguration.DFLT_PORT); check(new ClientConnectorConfiguration().setMaxOpenCursorsPerConnection(100), true); checkJdbc(null, ClientConnectorConfiguration.DFLT_PORT + 1); }
cliConnCfg.setMaxOpenCursorsPerConnection(sqlConnCfg.getMaxOpenCursorsPerConnection()); cliConnCfg.setPort(sqlConnCfg.getPort()); cliConnCfg.setPortRange(sqlConnCfg.getPortRange()); cliConnCfg.setSocketSendBufferSize(odbcCfg.getSocketSendBufferSize()); cliConnCfg.setSocketReceiveBufferSize(odbcCfg.getSocketReceiveBufferSize()); cliConnCfg.setMaxOpenCursorsPerConnection(odbcCfg.getMaxOpenCursors());
/** * Reads the client connector configuration. * * @param in Reader. * @return Config. */ private static ClientConnectorConfiguration readClientConnectorConfiguration(BinaryRawReader in) { return new ClientConnectorConfiguration() .setHost(in.readString()) .setPort(in.readInt()) .setPortRange(in.readInt()) .setSocketSendBufferSize(in.readInt()) .setSocketReceiveBufferSize(in.readInt()) .setTcpNoDelay(in.readBoolean()) .setMaxOpenCursorsPerConnection(in.readInt()) .setThreadPoolSize(in.readInt()) .setIdleTimeout(in.readLong()) .setThinClientEnabled(in.readBoolean()) .setOdbcEnabled(in.readBoolean()) .setJdbcEnabled(in.readBoolean()); }
cliConnCfg.setMaxOpenCursorsPerConnection(sqlConnCfg.getMaxOpenCursorsPerConnection()); cliConnCfg.setPort(sqlConnCfg.getPort()); cliConnCfg.setPortRange(sqlConnCfg.getPortRange()); cliConnCfg.setSocketSendBufferSize(odbcCfg.getSocketSendBufferSize()); cliConnCfg.setSocketReceiveBufferSize(odbcCfg.getSocketReceiveBufferSize()); cliConnCfg.setMaxOpenCursorsPerConnection(odbcCfg.getMaxOpenCursors());
/** * Reads the client connector configuration. * * @param in Reader. * @return Config. */ private static ClientConnectorConfiguration readClientConnectorConfiguration(BinaryRawReader in) { return new ClientConnectorConfiguration() .setHost(in.readString()) .setPort(in.readInt()) .setPortRange(in.readInt()) .setSocketSendBufferSize(in.readInt()) .setSocketReceiveBufferSize(in.readInt()) .setTcpNoDelay(in.readBoolean()) .setMaxOpenCursorsPerConnection(in.readInt()) .setThreadPoolSize(in.readInt()) .setIdleTimeout(in.readLong()) .setThinClientEnabled(in.readBoolean()) .setOdbcEnabled(in.readBoolean()) .setJdbcEnabled(in.readBoolean()); }