ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [13/58] [abbrv] incubator-ignite git commit: sprint-1 - JDBC renaming and reshuffling.
Date Fri, 06 Feb 2015 20:47:35 GMT
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/17d816fe/modules/core/src/main/java/org/apache/ignite/jdbc/IgniteJdbcConnection.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/jdbc/IgniteJdbcConnection.java b/modules/core/src/main/java/org/apache/ignite/jdbc/IgniteJdbcConnection.java
deleted file mode 100644
index f5cf638..0000000
--- a/modules/core/src/main/java/org/apache/ignite/jdbc/IgniteJdbcConnection.java
+++ /dev/null
@@ -1,547 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.jdbc;
-
-import org.apache.ignite.client.*;
-
-import java.sql.*;
-import java.util.*;
-import java.util.concurrent.*;
-
-import static java.sql.ResultSet.*;
-import static java.util.concurrent.TimeUnit.*;
-import static org.apache.ignite.jdbc.IgniteJdbcDriver.*;
-
-/**
- * JDBC connection implementation.
- */
-class IgniteJdbcConnection implements Connection {
-    /** Validation task name. */
-    private static final String VALID_TASK_NAME =
-        "org.apache.ignite.internal.processors.cache.query.jdbc.GridCacheQueryJdbcValidationTask";
-
-    /** GridGain client. */
-    private final GridClient client;
-
-    /** Cache name. */
-    private String cacheName;
-
-    /** Closed flag. */
-    private boolean closed;
-
-    /** URL. */
-    private String url;
-
-    /** Node ID. */
-    private UUID nodeId;
-
-    /** Timeout. */
-    private int timeout;
-
-    /**
-     * Creates new connection.
-     *
-     * @param url Connection URL.
-     * @param props Additional properties.
-     * @throws SQLException In case GridGain client failed to start.
-     */
-    IgniteJdbcConnection(String url, Properties props) throws SQLException {
-        assert url != null;
-        assert props != null;
-
-        this.url = url;
-        cacheName = props.getProperty(PROP_CACHE);
-
-        String nodeIdProp = props.getProperty(PROP_NODE_ID);
-
-        if (nodeIdProp != null)
-            nodeId = UUID.fromString(nodeIdProp);
-
-        try {
-            GridClientConfiguration cfg = new GridClientConfiguration(props);
-
-            cfg.setServers(Collections.singleton(props.getProperty(PROP_HOST) + ":" + props.getProperty(PROP_PORT)));
-
-            // Disable all fetching and caching for metadata.
-            cfg.setEnableMetricsCache(false);
-            cfg.setEnableAttributesCache(false);
-            cfg.setAutoFetchMetrics(false);
-            cfg.setAutoFetchAttributes(false);
-
-            client = GridClientFactory.start(cfg);
-        }
-        catch (GridClientException e) {
-            throw new SQLException("Failed to start GridGain client.", e);
-        }
-
-        if (!isValid(2))
-            throw new SQLException("Client is invalid. Probably cache name is wrong.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public Statement createStatement() throws SQLException {
-        return createStatement(TYPE_FORWARD_ONLY, CONCUR_READ_ONLY, HOLD_CURSORS_OVER_COMMIT);
-    }
-
-    /** {@inheritDoc} */
-    @Override public PreparedStatement prepareStatement(String sql) throws SQLException {
-        ensureNotClosed();
-
-        return prepareStatement(sql, TYPE_FORWARD_ONLY, CONCUR_READ_ONLY, HOLD_CURSORS_OVER_COMMIT);
-    }
-
-    /** {@inheritDoc} */
-    @Override public CallableStatement prepareCall(String sql) throws SQLException {
-        ensureNotClosed();
-
-        throw new SQLFeatureNotSupportedException("Callable functions are not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public String nativeSQL(String sql) throws SQLException {
-        ensureNotClosed();
-
-        return sql;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void setAutoCommit(boolean autoCommit) throws SQLException {
-        ensureNotClosed();
-
-        if (!autoCommit)
-            throw new SQLFeatureNotSupportedException("Transactions are not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean getAutoCommit() throws SQLException {
-        ensureNotClosed();
-
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void commit() throws SQLException {
-        ensureNotClosed();
-
-        throw new SQLFeatureNotSupportedException("Transactions are not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public void rollback() throws SQLException {
-        ensureNotClosed();
-
-        throw new SQLFeatureNotSupportedException("Transactions are not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public void close() throws SQLException {
-        if (closed)
-            return;
-
-        closed = true;
-
-        GridClientFactory.stop(client.id(), false);
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isClosed() throws SQLException {
-        return closed;
-    }
-
-    /** {@inheritDoc} */
-    @Override public DatabaseMetaData getMetaData() throws SQLException {
-        ensureNotClosed();
-
-        return new IgniteJdbcDatabaseMetadata(this);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void setReadOnly(boolean readOnly) throws SQLException {
-        ensureNotClosed();
-
-        if (!readOnly)
-            throw new SQLFeatureNotSupportedException("Updates are not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isReadOnly() throws SQLException {
-        ensureNotClosed();
-
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void setCatalog(String catalog) throws SQLException {
-        ensureNotClosed();
-
-        throw new SQLFeatureNotSupportedException("Catalogs are not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getCatalog() throws SQLException {
-        ensureNotClosed();
-
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void setTransactionIsolation(int level) throws SQLException {
-        ensureNotClosed();
-
-        throw new SQLFeatureNotSupportedException("Transactions are not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTransactionIsolation() throws SQLException {
-        ensureNotClosed();
-
-        throw new SQLFeatureNotSupportedException("Transactions are not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public SQLWarning getWarnings() throws SQLException {
-        ensureNotClosed();
-
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void clearWarnings() throws SQLException {
-        ensureNotClosed();
-    }
-
-    /** {@inheritDoc} */
-    @Override public Statement createStatement(int resSetType, int resSetConcurrency) throws SQLException {
-        return createStatement(resSetType, resSetConcurrency, HOLD_CURSORS_OVER_COMMIT);
-    }
-
-    /** {@inheritDoc} */
-    @Override public PreparedStatement prepareStatement(String sql, int resSetType,
-        int resSetConcurrency) throws SQLException {
-        ensureNotClosed();
-
-        return prepareStatement(sql, resSetType, resSetConcurrency, HOLD_CURSORS_OVER_COMMIT);
-    }
-
-    /** {@inheritDoc} */
-    @Override public CallableStatement prepareCall(String sql, int resSetType,
-        int resSetConcurrency) throws SQLException {
-        ensureNotClosed();
-
-        throw new SQLFeatureNotSupportedException("Callable functions are not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public Map<String, Class<?>> getTypeMap() throws SQLException {
-        throw new SQLFeatureNotSupportedException("Types mapping is not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
-        ensureNotClosed();
-
-        throw new SQLFeatureNotSupportedException("Types mapping is not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public void setHoldability(int holdability) throws SQLException {
-        ensureNotClosed();
-
-        if (holdability != HOLD_CURSORS_OVER_COMMIT)
-            throw new SQLFeatureNotSupportedException("Invalid holdability (transactions are not supported).");
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getHoldability() throws SQLException {
-        ensureNotClosed();
-
-        return HOLD_CURSORS_OVER_COMMIT;
-    }
-
-    /** {@inheritDoc} */
-    @Override public Savepoint setSavepoint() throws SQLException {
-        ensureNotClosed();
-
-        throw new SQLFeatureNotSupportedException("Transactions are not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public Savepoint setSavepoint(String name) throws SQLException {
-        ensureNotClosed();
-
-        throw new SQLFeatureNotSupportedException("Transactions are not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public void rollback(Savepoint savepoint) throws SQLException {
-        ensureNotClosed();
-
-        throw new SQLFeatureNotSupportedException("Transactions are not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public void releaseSavepoint(Savepoint savepoint) throws SQLException {
-        ensureNotClosed();
-
-        throw new SQLFeatureNotSupportedException("Transactions are not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public Statement createStatement(int resSetType, int resSetConcurrency,
-        int resSetHoldability) throws SQLException {
-        ensureNotClosed();
-
-        if (resSetType != TYPE_FORWARD_ONLY)
-            throw new SQLFeatureNotSupportedException("Invalid result set type (only forward is supported.)");
-
-        if (resSetConcurrency != CONCUR_READ_ONLY)
-            throw new SQLFeatureNotSupportedException("Invalid concurrency (updates are not supported).");
-
-        if (resSetHoldability != HOLD_CURSORS_OVER_COMMIT)
-            throw new SQLFeatureNotSupportedException("Invalid holdability (transactions are not supported).");
-
-        IgniteJdbcStatement stmt = new IgniteJdbcStatement(this);
-
-        if (timeout > 0)
-            stmt.timeout(timeout);
-
-        return stmt;
-    }
-
-    /** {@inheritDoc} */
-    @Override public PreparedStatement prepareStatement(String sql, int resSetType, int resSetConcurrency,
-        int resSetHoldability) throws SQLException {
-        ensureNotClosed();
-
-        if (resSetType != TYPE_FORWARD_ONLY)
-            throw new SQLFeatureNotSupportedException("Invalid result set type (only forward is supported.)");
-
-        if (resSetConcurrency != CONCUR_READ_ONLY)
-            throw new SQLFeatureNotSupportedException("Invalid concurrency (updates are not supported).");
-
-        if (resSetHoldability != HOLD_CURSORS_OVER_COMMIT)
-            throw new SQLFeatureNotSupportedException("Invalid holdability (transactions are not supported).");
-
-        IgniteJdbcPreparedStatement stmt = new IgniteJdbcPreparedStatement(this, sql);
-
-        if (timeout > 0)
-            stmt.timeout(timeout);
-
-        return stmt;
-    }
-
-    /** {@inheritDoc} */
-    @Override public CallableStatement prepareCall(String sql, int resSetType, int resSetConcurrency,
-        int resSetHoldability) throws SQLException {
-        ensureNotClosed();
-
-        throw new SQLFeatureNotSupportedException("Callable functions are not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
-        ensureNotClosed();
-
-        throw new SQLFeatureNotSupportedException("Updates are not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public PreparedStatement prepareStatement(String sql, int[] colIndexes) throws SQLException {
-        ensureNotClosed();
-
-        throw new SQLFeatureNotSupportedException("Updates are not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public PreparedStatement prepareStatement(String sql, String[] colNames) throws SQLException {
-        ensureNotClosed();
-
-        throw new SQLFeatureNotSupportedException("Updates are not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public Clob createClob() throws SQLException {
-        ensureNotClosed();
-
-        throw new SQLFeatureNotSupportedException("SQL-specific types are not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public Blob createBlob() throws SQLException {
-        ensureNotClosed();
-
-        throw new SQLFeatureNotSupportedException("SQL-specific types are not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public NClob createNClob() throws SQLException {
-        ensureNotClosed();
-
-        throw new SQLFeatureNotSupportedException("SQL-specific types are not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public SQLXML createSQLXML() throws SQLException {
-        ensureNotClosed();
-
-        throw new SQLFeatureNotSupportedException("SQL-specific types are not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isValid(int timeout) throws SQLException {
-        ensureNotClosed();
-
-        if (timeout < 0)
-            throw new SQLException("Invalid timeout: " + timeout);
-
-        try {
-            return client.compute().<Boolean>executeAsync(VALID_TASK_NAME, cacheName).get(timeout, SECONDS);
-        }
-        catch (GridClientDisconnectedException | GridClientFutureTimeoutException e) {
-            throw new SQLException("Failed to establish connection.", e);
-        }
-        catch (GridClientException ignored) {
-            return false;
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public void setClientInfo(String name, String val) throws SQLClientInfoException {
-        throw new UnsupportedOperationException("Client info is not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public void setClientInfo(Properties props) throws SQLClientInfoException {
-        throw new UnsupportedOperationException("Client info is not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getClientInfo(String name) throws SQLException {
-        ensureNotClosed();
-
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public Properties getClientInfo() throws SQLException {
-        ensureNotClosed();
-
-        return new Properties();
-    }
-
-    /** {@inheritDoc} */
-    @Override public Array createArrayOf(String typeName, Object[] elements) throws SQLException {
-        ensureNotClosed();
-
-        throw new SQLFeatureNotSupportedException("SQL-specific types are not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public Struct createStruct(String typeName, Object[] attrs) throws SQLException {
-        ensureNotClosed();
-
-        throw new SQLFeatureNotSupportedException("SQL-specific types are not supported.");
-    }
-
-    /** {@inheritDoc} */
-    @Override public <T> T unwrap(Class<T> iface) throws SQLException {
-        if (!isWrapperFor(iface))
-            throw new SQLException("Connection is not a wrapper for " + iface.getName());
-
-        return (T)this;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isWrapperFor(Class<?> iface) throws SQLException {
-        return iface != null && iface == Connection.class;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void setSchema(String schema) throws SQLException {
-        cacheName = schema;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getSchema() throws SQLException {
-        return cacheName;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void abort(Executor executor) throws SQLException {
-        close();
-    }
-
-    /** {@inheritDoc} */
-    @Override public void setNetworkTimeout(Executor executor, int ms) throws SQLException {
-        if (ms < 0)
-            throw new IllegalArgumentException("Timeout is below zero: " + ms);
-
-        timeout = ms;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getNetworkTimeout() throws SQLException {
-        return timeout;
-    }
-
-    /**
-     * @return GridGain client.
-     */
-    GridClient client() {
-        return client;
-    }
-
-    /**
-     * @return Cache name.
-     */
-    String cacheName() {
-        return cacheName;
-    }
-
-    /**
-     * @return URL.
-     */
-    String url() {
-        return url;
-    }
-
-    /**
-     * @return Node ID.
-     */
-    UUID nodeId() {
-        return nodeId;
-    }
-
-    /**
-     * Ensures that connection is not closed.
-     *
-     * @throws SQLException If connection is closed.
-     */
-    private void ensureNotClosed() throws SQLException {
-        if (closed)
-            throw new SQLException("Connection is closed.");
-    }
-
-    /**
-     * @return Internal statement.
-     * @throws SQLException In case of error.
-     */
-    IgniteJdbcStatement createStatement0() throws SQLException {
-        return (IgniteJdbcStatement)createStatement();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/17d816fe/modules/core/src/main/java/org/apache/ignite/jdbc/IgniteJdbcConnectionInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/jdbc/IgniteJdbcConnectionInfo.java b/modules/core/src/main/java/org/apache/ignite/jdbc/IgniteJdbcConnectionInfo.java
deleted file mode 100644
index 6622754..0000000
--- a/modules/core/src/main/java/org/apache/ignite/jdbc/IgniteJdbcConnectionInfo.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.jdbc;
-
-/**
- * Connection properties.
- */
-class IgniteJdbcConnectionInfo {
-    /** URL. */
-    private final String url;
-
-    /** Hostname. */
-    private String hostname;
-
-    /** Port number. */
-    private int port;
-
-    /** Cache name. */
-    private String cacheName;
-
-    /**
-     * @param url URL.
-     */
-    IgniteJdbcConnectionInfo(String url) {
-        this.url = url;
-    }
-
-    /**
-     * @return URL.
-     */
-    public String url() {
-        return url;
-    }
-
-    /**
-     * @return Hostname.
-     */
-    public String hostname() {
-        return hostname;
-    }
-
-    /**
-     * @param hostname Hostname.
-     */
-    public void hostname(String hostname) {
-        this.hostname = hostname;
-    }
-
-    /**
-     * @return Port number.
-     */
-    public int port() {
-        return port;
-    }
-
-    /**
-     * @param port Port number.
-     */
-    public void port(int port) {
-        this.port = port;
-    }
-
-    /**
-     * @return Cache name.
-     */
-    public String cacheName() {
-        return cacheName;
-    }
-
-    /**
-     * @param cacheName Cache name.
-     */
-    public void cacheName(String cacheName) {
-        this.cacheName = cacheName;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/17d816fe/modules/core/src/main/java/org/apache/ignite/jdbc/IgniteJdbcDatabaseMetadata.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/jdbc/IgniteJdbcDatabaseMetadata.java b/modules/core/src/main/java/org/apache/ignite/jdbc/IgniteJdbcDatabaseMetadata.java
deleted file mode 100644
index d4b7919..0000000
--- a/modules/core/src/main/java/org/apache/ignite/jdbc/IgniteJdbcDatabaseMetadata.java
+++ /dev/null
@@ -1,1314 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.jdbc;
-
-import org.apache.ignite.client.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.jdbc.typedef.*;
-
-import java.sql.*;
-import java.util.*;
-
-import static java.sql.Connection.*;
-import static java.sql.ResultSet.*;
-import static java.sql.RowIdLifetime.*;
-
-/**
- * JDBC database metadata implementation.
- */
-@SuppressWarnings("RedundantCast")
-class IgniteJdbcDatabaseMetadata implements DatabaseMetaData {
-    /** Task name. */
-    private static final String TASK_NAME =
-        "org.apache.ignite.internal.processors.cache.query.jdbc.GridCacheQueryJdbcMetadataTask";
-
-    /** Connection. */
-    private final IgniteJdbcConnection conn;
-
-    /** Metadata. */
-    private Map<String, Map<String, Map<String, String>>> meta;
-
-    /** Index info. */
-    private Collection<List<Object>> indexes;
-
-    /**
-     * @param conn Connection.
-     */
-    IgniteJdbcDatabaseMetadata(IgniteJdbcConnection conn) {
-        this.conn = conn;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean allProceduresAreCallable() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean allTablesAreSelectable() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getURL() throws SQLException {
-        return conn.url();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getUserName() throws SQLException {
-        return "";
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isReadOnly() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean nullsAreSortedHigh() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean nullsAreSortedLow() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean nullsAreSortedAtStart() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean nullsAreSortedAtEnd() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getDatabaseProductName() throws SQLException {
-        return "GridGain Cache";
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getDatabaseProductVersion() throws SQLException {
-        return "4.1.0";
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getDriverName() throws SQLException {
-        return "GridGain JDBC Driver";
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getDriverVersion() throws SQLException {
-        return "1.0";
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getDriverMajorVersion() {
-        return 1;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getDriverMinorVersion() {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean usesLocalFiles() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean usesLocalFilePerTable() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsMixedCaseIdentifiers() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean storesUpperCaseIdentifiers() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean storesLowerCaseIdentifiers() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean storesMixedCaseIdentifiers() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean storesUpperCaseQuotedIdentifiers() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean storesLowerCaseQuotedIdentifiers() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean storesMixedCaseQuotedIdentifiers() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getIdentifierQuoteString() throws SQLException {
-        return " ";
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getSQLKeywords() throws SQLException {
-        return "";
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getNumericFunctions() throws SQLException {
-        return "";
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getStringFunctions() throws SQLException {
-        return "";
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getSystemFunctions() throws SQLException {
-        return "";
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getTimeDateFunctions() throws SQLException {
-        return "";
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getSearchStringEscape() throws SQLException {
-        return "";
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getExtraNameCharacters() throws SQLException {
-        return "";
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsAlterTableWithAddColumn() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsAlterTableWithDropColumn() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsColumnAliasing() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean nullPlusNonNullIsNull() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsConvert() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsConvert(int fromType, int toType) throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsTableCorrelationNames() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsDifferentTableCorrelationNames() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsExpressionsInOrderBy() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsOrderByUnrelated() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsGroupBy() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsGroupByUnrelated() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsGroupByBeyondSelect() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsLikeEscapeClause() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsMultipleResultSets() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsMultipleTransactions() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsNonNullableColumns() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsMinimumSQLGrammar() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsCoreSQLGrammar() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsExtendedSQLGrammar() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsANSI92EntryLevelSQL() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsANSI92IntermediateSQL() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsANSI92FullSQL() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsIntegrityEnhancementFacility() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsOuterJoins() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsFullOuterJoins() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsLimitedOuterJoins() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getSchemaTerm() throws SQLException {
-        return "";
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getProcedureTerm() throws SQLException {
-        return "";
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getCatalogTerm() throws SQLException {
-        return "";
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isCatalogAtStart() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getCatalogSeparator() throws SQLException {
-        return "";
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsSchemasInDataManipulation() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsSchemasInProcedureCalls() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsSchemasInTableDefinitions() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsSchemasInIndexDefinitions() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsSchemasInPrivilegeDefinitions() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsCatalogsInDataManipulation() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsCatalogsInProcedureCalls() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsCatalogsInTableDefinitions() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsCatalogsInIndexDefinitions() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsPositionedDelete() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsPositionedUpdate() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsSelectForUpdate() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsStoredProcedures() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsSubqueriesInComparisons() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsSubqueriesInExists() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsSubqueriesInIns() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsSubqueriesInQuantifieds() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsCorrelatedSubqueries() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsUnion() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsUnionAll() throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsOpenCursorsAcrossCommit() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsOpenCursorsAcrossRollback() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsOpenStatementsAcrossCommit() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsOpenStatementsAcrossRollback() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getMaxBinaryLiteralLength() throws SQLException {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getMaxCharLiteralLength() throws SQLException {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getMaxColumnNameLength() throws SQLException {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getMaxColumnsInGroupBy() throws SQLException {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getMaxColumnsInIndex() throws SQLException {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getMaxColumnsInOrderBy() throws SQLException {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getMaxColumnsInSelect() throws SQLException {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getMaxColumnsInTable() throws SQLException {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getMaxConnections() throws SQLException {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getMaxCursorNameLength() throws SQLException {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getMaxIndexLength() throws SQLException {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getMaxSchemaNameLength() throws SQLException {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getMaxProcedureNameLength() throws SQLException {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getMaxCatalogNameLength() throws SQLException {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getMaxRowSize() throws SQLException {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean doesMaxRowSizeIncludeBlobs() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getMaxStatementLength() throws SQLException {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getMaxStatements() throws SQLException {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getMaxTableNameLength() throws SQLException {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getMaxTablesInSelect() throws SQLException {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getMaxUserNameLength() throws SQLException {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getDefaultTransactionIsolation() throws SQLException {
-        return TRANSACTION_NONE;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsTransactions() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsTransactionIsolationLevel(int level) throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsDataDefinitionAndDataManipulationTransactions() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsDataManipulationTransactionsOnly() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean dataDefinitionCausesTransactionCommit() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean dataDefinitionIgnoredInTransactions() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getProcedures(String catalog, String schemaPtrn,
-        String procedureNamePtrn) throws SQLException {
-        return new IgniteJdbcResultSet(
-            conn.createStatement0(),
-            Collections.<String>emptyList(),
-            Arrays.asList("PROCEDURE_CAT", "PROCEDURE_SCHEM", "PROCEDURE_NAME",
-                "REMARKS", "PROCEDURE_TYPE", "SPECIFIC_NAME"),
-            Arrays.<String>asList(String.class.getName(), String.class.getName(), String.class.getName(),
-                String.class.getName(), Short.class.getName(), String.class.getName()),
-            Collections.<List<Object>>emptyList()
-        );
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getProcedureColumns(String catalog, String schemaPtrn, String procedureNamePtrn,
-        String colNamePtrn) throws SQLException {
-        return new IgniteJdbcResultSet(
-            conn.createStatement0(),
-            Collections.<String>emptyList(),
-            Arrays.asList("PROCEDURE_CAT", "PROCEDURE_SCHEM", "PROCEDURE_NAME",
-                "COLUMN_NAME", "COLUMN_TYPE", "DATA_TYPE", "TYPE_NAME", "PRECISION",
-                "LENGTH", "SCALE", "RADIX", "NULLABLE", "REMARKS", "COLUMN_DEF",
-                "SQL_DATA_TYPE", "SQL_DATETIME_SUB", "CHAR_OCTET_LENGTH",
-                "ORDINAL_POSITION", "IS_NULLABLE", "SPECIFIC_NAME"),
-            Arrays.<String>asList(String.class.getName(), String.class.getName(), String.class.getName(),
-                String.class.getName(), Short.class.getName(), Integer.class.getName(), String.class.getName(),
-                Integer.class.getName(), Integer.class.getName(), Short.class.getName(), Short.class.getName(),
-                Short.class.getName(), String.class.getName(), String.class.getName(), Integer.class.getName(),
-                Integer.class.getName(), Integer.class.getName(), Integer.class.getName(), String.class.getName(),
-                String.class.getName()),
-            Collections.<List<Object>>emptyList()
-        );
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getTables(String catalog, String schemaPtrn, String tblNamePtrn,
-        String[] tblTypes) throws SQLException {
-        updateMetaData();
-
-        List<List<Object>> rows = new LinkedList<>();
-
-        if (tblTypes == null || Arrays.asList(tblTypes).contains("TABLE"))
-            for (Map.Entry<String, Map<String, Map<String, String>>> schema : meta.entrySet())
-                if (matches(schema.getKey(), schemaPtrn))
-                    for (String tbl : schema.getValue().keySet())
-                        if (matches(tbl, tblNamePtrn))
-                            rows.add(tableRow(schema.getKey(), tbl));
-
-        return new IgniteJdbcResultSet(
-            conn.createStatement0(),
-            Collections.<String>emptyList(),
-            Arrays.asList("TABLE_CAT", "TABLE_SCHEM", "TABLE_NAME", "TABLE_TYPE", "REMARKS", "TYPE_CAT",
-                "TYPE_SCHEM", "TYPE_NAME", "SELF_REFERENCING_COL_NAME", "REF_GENERATION"),
-            Arrays.<String>asList(String.class.getName(), String.class.getName(), String.class.getName(),
-                String.class.getName(), String.class.getName(), String.class.getName(), String.class.getName(),
-                String.class.getName(), String.class.getName(), String.class.getName()),
-            rows
-        );
-    }
-
-    /**
-     * @param schema Schema name.
-     * @param tbl Table name.
-     * @return Table metadata row.
-     */
-    private List<Object> tableRow(String schema, String tbl) {
-        List<Object> row = new ArrayList<>(10);
-
-        row.add((String)null);
-        row.add(schema);
-        row.add(tbl.toUpperCase());
-        row.add("TABLE");
-        row.add((String)null);
-        row.add((String)null);
-        row.add((String)null);
-        row.add((String)null);
-        row.add((String)null);
-        row.add((String)null);
-
-        return row;
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getSchemas() throws SQLException {
-        return getSchemas(null, "%");
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getCatalogs() throws SQLException {
-        return new IgniteJdbcResultSet(
-            conn.createStatement0(),
-            Collections.<String>emptyList(),
-            Arrays.asList("TABLE_CAT"),
-            Arrays.<String>asList(String.class.getName()),
-            Collections.<List<Object>>emptyList()
-        );
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getTableTypes() throws SQLException {
-        return new IgniteJdbcResultSet(conn.createStatement0(),
-            Collections.<String>emptyList(),
-            Collections.singletonList("TABLE_TYPE"),
-            Collections.<String>singletonList(String.class.getName()),
-            Collections.singletonList(Collections.<Object>singletonList("TABLE")));
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getColumns(String catalog, String schemaPtrn, String tblNamePtrn,
-        String colNamePtrn) throws SQLException {
-        updateMetaData();
-
-        List<List<Object>> rows = new LinkedList<>();
-
-        int cnt = 0;
-
-        for (Map.Entry<String, Map<String, Map<String, String>>> schema : meta.entrySet())
-            if (matches(schema.getKey(), schemaPtrn))
-                for (Map.Entry<String, Map<String, String>> tbl : schema.getValue().entrySet())
-                    if (matches(tbl.getKey(), tblNamePtrn))
-                        for (Map.Entry<String, String> col : tbl.getValue().entrySet())
-                            rows.add(columnRow(schema.getKey(), tbl.getKey(), col.getKey(),
-                                JU.type(col.getValue()), JU.typeName(col.getValue()),
-                                JU.nullable(col.getKey(), col.getValue()), ++cnt));
-
-        return new IgniteJdbcResultSet(
-            conn.createStatement0(),
-            Collections.<String>emptyList(),
-            Arrays.asList("TABLE_CAT", "TABLE_SCHEM", "TABLE_NAME", "COLUMN_NAME", "DATA_TYPE",
-                "TYPE_NAME", "COLUMN_SIZE", "DECIMAL_DIGITS", "NUM_PREC_RADIX", "NULLABLE",
-                "REMARKS", "COLUMN_DEF", "CHAR_OCTET_LENGTH", "ORDINAL_POSITION", "IS_NULLABLE",
-                "SCOPE_CATLOG", "SCOPE_SCHEMA", "SCOPE_TABLE", "SOURCE_DATA_TYPE", "IS_AUTOINCREMENT"),
-            Arrays.<String>asList(String.class.getName(), String.class.getName(), String.class.getName(),
-                String.class.getName(), Integer.class.getName(), String.class.getName(), Integer.class.getName(),
-                Integer.class.getName(), Integer.class.getName(), Integer.class.getName(), String.class.getName(),
-                String.class.getName(), Integer.class.getName(), Integer.class.getName(), String.class.getName(),
-                String.class.getName(), String.class.getName(), String.class.getName(), Short.class.getName(),
-                String.class.getName()),
-            rows
-        );
-    }
-
-    /**
-     * @param schema Schema name.
-     * @param tbl Table name.
-     * @param col Column name.
-     * @param type Type.
-     * @param typeName Type name.
-     * @param nullable Nullable flag.
-     * @param pos Ordinal position.
-     * @return Column metadata row.
-     */
-    private List<Object> columnRow(String schema, String tbl, String col, int type, String typeName,
-        boolean nullable, int pos) {
-        List<Object> row = new ArrayList<>(20);
-
-        row.add((String)null);
-        row.add(schema);
-        row.add(tbl);
-        row.add(col);
-        row.add(type);
-        row.add(typeName);
-        row.add((Integer)null);
-        row.add((Integer)null);
-        row.add(10);
-        row.add(nullable ? columnNullable : columnNoNulls);
-        row.add((String)null);
-        row.add((String)null);
-        row.add(Integer.MAX_VALUE);
-        row.add(pos);
-        row.add("YES");
-        row.add((String)null);
-        row.add((String)null);
-        row.add((String)null);
-        row.add((Short)null);
-        row.add("NO");
-
-        return row;
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getColumnPrivileges(String catalog, String schema, String tbl,
-        String colNamePtrn) throws SQLException {
-        return new IgniteJdbcResultSet(
-            conn.createStatement0(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<List<Object>>emptyList()
-        );
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getTablePrivileges(String catalog, String schemaPtrn,
-        String tblNamePtrn) throws SQLException {
-        return new IgniteJdbcResultSet(
-            conn.createStatement0(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<List<Object>>emptyList()
-        );
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getBestRowIdentifier(String catalog, String schema, String tbl, int scope,
-        boolean nullable) throws SQLException {
-        return new IgniteJdbcResultSet(
-            conn.createStatement0(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<List<Object>>emptyList()
-        );
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getVersionColumns(String catalog, String schema, String tbl) throws SQLException {
-        return new IgniteJdbcResultSet(
-            conn.createStatement0(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<List<Object>>emptyList()
-        );
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getPrimaryKeys(String catalog, String schema, String tbl) throws SQLException {
-        updateMetaData();
-
-        List<List<Object>> rows = new LinkedList<>();
-
-        for (Map.Entry<String, Map<String, Map<String, String>>> s : meta.entrySet())
-            if (schema == null || schema.toUpperCase().equals(s.getKey()))
-                for (Map.Entry<String, Map<String, String>> t : s.getValue().entrySet())
-                    if (tbl == null || tbl.toUpperCase().equals(t.getKey()))
-                        rows.add(Arrays.<Object>asList((String)null, s.getKey().toUpperCase(),
-                            t.getKey().toUpperCase(), "_KEY", 1, "_KEY"));
-
-        return new IgniteJdbcResultSet(
-            conn.createStatement0(),
-            Collections.<String>emptyList(),
-            Arrays.asList("TABLE_CAT", "TABLE_SCHEM", "TABLE_NAME", "COLUMN_NAME", "KEY_SEQ", "PK_NAME"),
-            Arrays.asList(String.class.getName(), String.class.getName(), String.class.getName(),
-                String.class.getName(), Short.class.getName(), String.class.getName()),
-            rows
-        );
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getImportedKeys(String catalog, String schema, String tbl) throws SQLException {
-        return new IgniteJdbcResultSet(
-            conn.createStatement0(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<List<Object>>emptyList()
-        );
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getExportedKeys(String catalog, String schema, String tbl) throws SQLException {
-        return new IgniteJdbcResultSet(
-            conn.createStatement0(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<List<Object>>emptyList()
-        );
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getCrossReference(String parentCatalog, String parentSchema, String parentTbl,
-        String foreignCatalog, String foreignSchema, String foreignTbl) throws SQLException {
-        return new IgniteJdbcResultSet(
-            conn.createStatement0(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<List<Object>>emptyList()
-        );
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getTypeInfo() throws SQLException {
-        return new IgniteJdbcResultSet(
-            conn.createStatement0(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<List<Object>>emptyList()
-        );
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getIndexInfo(String catalog, String schema, String tbl, boolean unique,
-        boolean approximate) throws SQLException {
-        Collection<List<Object>> rows = new ArrayList<>(indexes.size());
-
-        for (List<Object> idx : indexes) {
-            String idxSchema = (String)idx.get(0);
-            String idxTbl = (String)idx.get(1);
-
-            if ((schema == null || schema.equals(idxSchema)) && (tbl == null || tbl.equals(idxTbl))) {
-                List<Object> row = new ArrayList<>(13);
-
-                row.add((String)null);
-                row.add(idxSchema);
-                row.add(idxTbl);
-                row.add((Boolean)idx.get(2));
-                row.add((String)null);
-                row.add((String)idx.get(3));
-                row.add((int)tableIndexOther);
-                row.add((Integer)idx.get(4));
-                row.add((String)idx.get(5));
-                row.add((Boolean)idx.get(6) ? "D" : "A");
-                row.add(0);
-                row.add(0);
-                row.add((String)null);
-
-                rows.add(row);
-            }
-        }
-
-        return new IgniteJdbcResultSet(
-            conn.createStatement0(),
-            Collections.<String>emptyList(),
-            Arrays.asList("TABLE_CAT", "TABLE_SCHEM", "TABLE_NAME", "NON_UNIQUE", "INDEX_QUALIFIER",
-                "INDEX_NAME", "TYPE", "ORDINAL_POSITION", "COLUMN_NAME", "ASC_OR_DESC", "CARDINALITY",
-                "PAGES", "FILTER_CONDITION"),
-            Arrays.asList(String.class.getName(), String.class.getName(), String.class.getName(),
-                Boolean.class.getName(), String.class.getName(), String.class.getName(), Short.class.getName(),
-                Short.class.getName(), String.class.getName(), String.class.getName(), Integer.class.getName(),
-                Integer.class.getName(), String.class.getName()),
-            rows
-        );
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsResultSetType(int type) throws SQLException {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsResultSetConcurrency(int type, int concurrency) throws SQLException {
-        return concurrency == CONCUR_READ_ONLY;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean ownUpdatesAreVisible(int type) throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean ownDeletesAreVisible(int type) throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean ownInsertsAreVisible(int type) throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean othersUpdatesAreVisible(int type) throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean othersDeletesAreVisible(int type) throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean othersInsertsAreVisible(int type) throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean updatesAreDetected(int type) throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean deletesAreDetected(int type) throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean insertsAreDetected(int type) throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsBatchUpdates() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getUDTs(String catalog, String schemaPtrn, String typeNamePtrn,
-        int[] types) throws SQLException {
-        return new IgniteJdbcResultSet(
-            conn.createStatement0(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<List<Object>>emptyList()
-        );
-    }
-
-    /** {@inheritDoc} */
-    @Override public Connection getConnection() throws SQLException {
-        return conn;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsSavepoints() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsNamedParameters() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsMultipleOpenResults() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsGetGeneratedKeys() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getSuperTypes(String catalog, String schemaPtrn,
-        String typeNamePtrn) throws SQLException {
-        return new IgniteJdbcResultSet(
-            conn.createStatement0(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<List<Object>>emptyList()
-        );
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getSuperTables(String catalog, String schemaPtrn,
-        String tblNamePtrn) throws SQLException {
-        return new IgniteJdbcResultSet(
-            conn.createStatement0(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<List<Object>>emptyList()
-        );
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getAttributes(String catalog, String schemaPtrn, String typeNamePtrn,
-        String attributeNamePtrn) throws SQLException {
-        return new IgniteJdbcResultSet(
-            conn.createStatement0(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<List<Object>>emptyList()
-        );
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsResultSetHoldability(int holdability) throws SQLException {
-        return holdability == HOLD_CURSORS_OVER_COMMIT;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getResultSetHoldability() throws SQLException {
-        return HOLD_CURSORS_OVER_COMMIT;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getDatabaseMajorVersion() throws SQLException {
-        return 1;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getDatabaseMinorVersion() throws SQLException {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getJDBCMajorVersion() throws SQLException {
-        return 1;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getJDBCMinorVersion() throws SQLException {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getSQLStateType() throws SQLException {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean locatorsUpdateCopy() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsStatementPooling() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public RowIdLifetime getRowIdLifetime() throws SQLException {
-        return ROWID_UNSUPPORTED;
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getSchemas(String catalog, String schemaPtrn) throws SQLException {
-        updateMetaData();
-
-        List<List<Object>> rows = new ArrayList<>(meta.size());
-
-        for (String schema : meta.keySet())
-            if (matches(schema, schemaPtrn))
-                rows.add(Arrays.<Object>asList(schema, (String)null));
-
-        return new IgniteJdbcResultSet(
-            conn.createStatement0(),
-            Collections.<String>emptyList(),
-            Arrays.asList("TABLE_SCHEM", "TABLE_CATALOG"),
-            Arrays.<String>asList(String.class.getName(), String.class.getName()),
-            rows
-        );
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean autoCommitFailureClosesAllResultSets() throws SQLException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getClientInfoProperties() throws SQLException {
-        return new IgniteJdbcResultSet(
-            conn.createStatement0(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<List<Object>>emptyList()
-        );
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getFunctions(String catalog, String schemaPtrn,
-        String functionNamePtrn) throws SQLException {
-        return new IgniteJdbcResultSet(
-            conn.createStatement0(),
-            Collections.<String>emptyList(),
-            Arrays.asList("FUNCTION_CAT", "FUNCTION_SCHEM", "FUNCTION_NAME",
-                "REMARKS", "FUNCTION_TYPE", "SPECIFIC_NAME"),
-            Arrays.<String>asList(String.class.getName(), String.class.getName(), String.class.getName(),
-                String.class.getName(), Short.class.getName(), String.class.getName()),
-            Collections.<List<Object>>emptyList()
-        );
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getFunctionColumns(String catalog, String schemaPtrn, String functionNamePtrn,
-        String colNamePtrn) throws SQLException {
-        return new IgniteJdbcResultSet(
-            conn.createStatement0(),
-            Collections.<String>emptyList(),
-            Arrays.asList("FUNCTION_CAT", "FUNCTION_SCHEM", "FUNCTION_NAME",
-                "COLUMN_NAME", "COLUMN_TYPE", "DATA_TYPE", "TYPE_NAME", "PRECISION",
-                "LENGTH", "SCALE", "RADIX", "NULLABLE", "REMARKS", "CHAR_OCTET_LENGTH",
-                "ORDINAL_POSITION", "IS_NULLABLE", "SPECIFIC_NAME"),
-            Arrays.<String>asList(String.class.getName(), String.class.getName(), String.class.getName(),
-                String.class.getName(), Short.class.getName(), Integer.class.getName(), String.class.getName(),
-                Integer.class.getName(), Integer.class.getName(), Short.class.getName(), Short.class.getName(),
-                Short.class.getName(), String.class.getName(), Integer.class.getName(), Integer.class.getName(),
-                String.class.getName(), String.class.getName()),
-            Collections.<List<Object>>emptyList()
-        );
-    }
-
-    /** {@inheritDoc} */
-    @Override public <T> T unwrap(Class<T> iface) throws SQLException {
-        if (!isWrapperFor(iface))
-            throw new SQLException("Database meta data is not a wrapper for " + iface.getName());
-
-        return (T)this;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isWrapperFor(Class<?> iface) throws SQLException {
-        return iface != null && iface == DatabaseMetaData.class;
-    }
-
-    /** {@inheritDoc} */
-    @Override public ResultSet getPseudoColumns(String catalog, String schemaPtrn, String tblNamePtrn,
-        String colNamePtrn) throws SQLException {
-        return new IgniteJdbcResultSet(
-            conn.createStatement0(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<String>emptyList(),
-            Collections.<List<Object>>emptyList()
-        );
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean generatedKeyAlwaysReturned() throws SQLException {
-        return false;
-    }
-
-    /**
-     * Updates meta data.
-     *
-     * @throws SQLException In case of error.
-     */
-    private void updateMetaData() throws SQLException {
-        if (conn.isClosed())
-            throw new SQLException("Connection is closed.");
-
-        try {
-            byte[] packet = conn.client().compute().execute(TASK_NAME, conn.cacheName());
-
-            byte status = packet[0];
-            byte[] data = new byte[packet.length - 1];
-
-            U.arrayCopy(packet, 1, data, 0, data.length);
-
-            if (status == 1)
-                throw JU.unmarshalError(data);
-            else {
-                List<Object> res = JU.unmarshal(data);
-
-                meta = (Map<String, Map<String, Map<String, String>>>)res.get(0);
-                indexes = (Collection<List<Object>>)res.get(1);
-            }
-        }
-        catch (GridClientException e) {
-            throw new SQLException("Failed to get meta data from GridGain.", e);
-        }
-    }
-
-    /**
-     * Checks whether string matches SQL pattern.
-     *
-     * @param str String.
-     * @param ptrn Pattern.
-     * @return Whether string matches pattern.
-     */
-    private boolean matches(String str, String ptrn) {
-        return str != null && (ptrn == null ||
-            str.toUpperCase().matches(ptrn.toUpperCase().replace("%", ".*").replace("_", ".")));
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/17d816fe/modules/core/src/main/java/org/apache/ignite/jdbc/IgniteJdbcDriver.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/jdbc/IgniteJdbcDriver.java b/modules/core/src/main/java/org/apache/ignite/jdbc/IgniteJdbcDriver.java
deleted file mode 100644
index 8ea267c..0000000
--- a/modules/core/src/main/java/org/apache/ignite/jdbc/IgniteJdbcDriver.java
+++ /dev/null
@@ -1,482 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.jdbc;
-
-
-import java.sql.*;
-import java.util.*;
-import java.util.logging.*;
-
-/**
- * JDBC driver implementation for In-Memory Data Grid.
- * <p>
- * Driver allows to get distributed data from GridGain cache using standard
- * SQL queries and standard JDBC API. It will automatically get only fields that
- * you actually need from objects stored in cache.
- * <h1 class="header">Limitations</h1>
- * Data in GridGain cache is usually distributed across several nodes,
- * so some queries may not work as expected since the query will be sent to each
- * individual node and results will then be collected and returned as JDBC result set.
- * Keep in mind following limitations (not applied if data is queried from one node only,
- * or data is fully co-located or fully replicated on multiple nodes):
- * <ul>
- *     <li>
- *         {@code Group by} and {@code sort by} statements are applied separately
- *         on each node, so result set will likely be incorrectly grouped or sorted
- *         after results from multiple remote nodes are grouped together.
- *     </li>
- *     <li>
- *         Aggregation functions like {@code sum}, {@code max}, {@code avg}, etc.
- *         are also applied on each node. Therefore you will get several results
- *         containing aggregated values, one for each node.
- *     </li>
- *     <li>
- *         Joins will work correctly only if joined objects are stored in
- *         collocated mode. Refer to
- *         {@link org.apache.ignite.cache.affinity.CacheAffinityKey}
- *         javadoc for more details.
- *     </li>
- *     <li>
- *         Note that if you are connected to local or replicated cache, all data will
- *         be queried only on one node, not depending on what caches participate in
- *         the query (some data from partitioned cache can be lost). And visa versa,
- *         if you are connected to partitioned cache, data from replicated caches
- *         will be duplicated.
- *     </li>
- * </ul>
- * <h1 class="header">SQL Notice</h1>
- * Driver allows to query data from several caches. Cache that driver is connected to is
- * treated as default schema in this case. Other caches can be referenced by their names.
- * <p>
- * Note that cache name is case sensitive and you have to always specify it in quotes.
- * <h1 class="header">Dependencies</h1>
- * JDBC driver is located in main GridGain JAR and depends on all libraries located in
- * {@code IGNITE_HOME/libs} folder. So if you are using JDBC driver in any external tool,
- * you have to add main GridGain JAR will all dependencies to its classpath.
- * <h1 class="header">Configuration</h1>
- * Internally JDBC driver <b>is based on GridGain Java client</b>. Therefore, all client
- * configuration properties can be applied to JDBC connection.
- * <p>
- * JDBC connection URL has the following pattern:
- * {@code jdbc:gridgain://<hostname>:<port>/<cache_name>?nodeId=<UUID>}<br>
- * Note the following:
- * <ul>
- *     <li>Hostname is required.</li>
- *     <li>If port is not defined, {@code 11211} is used (default for GridGain client).</li>
- *     <li>Leave {@code <cache_name>} empty if you are connecting to default cache.</li>
- *     <li>
- *         Provide {@code nodeId} parameter if you want to specify node where to execute
- *         your queries. Note that local and replicated caches will be queried locally on
- *         this node while partitioned cache is queried distributively. If node ID is not
- *         provided, random node is used. If node with provided ID doesn't exist,
- *         exception is thrown.
- *     </li>
- * </ul>
- * Other properties can be defined in {@link Properties} object passed to
- * {@link DriverManager#getConnection(String, Properties)} method:
- * <table class="doctable">
- *     <tr>
- *         <th>Name</th>
- *         <th>Description</th>
- *         <th>Default</th>
- *         <th>Optional</th>
- *     </tr>
- *     <tr>
- *         <td><b>gg.client.protocol</b></td>
- *         <td>Communication protocol ({@code TCP} or {@code HTTP}).</td>
- *         <td>{@code TCP}</td>
- *         <td>Yes</td>
- *     </tr>
- *     <tr>
- *         <td><b>gg.client.connectTimeout</b></td>
- *         <td>Socket connection timeout.</td>
- *         <td>{@code 0} (infinite timeout)</td>
- *         <td>Yes</td>
- *     </tr>
- *     <tr>
- *         <td><b>gg.client.tcp.noDelay</b></td>
- *         <td>Flag indicating whether TCP_NODELAY flag should be enabled for outgoing connections.</td>
- *         <td>{@code true}</td>
- *         <td>Yes</td>
- *     </tr>
- *     <tr>
- *         <td><b>gg.client.ssl.enabled</b></td>
- *         <td>Flag indicating that {@code SSL} is needed for connection.</td>
- *         <td>{@code false}</td>
- *         <td>Yes</td>
- *     </tr>
- *     <tr>
- *         <td><b>gg.client.ssl.protocol</b></td>
- *         <td>SSL protocol ({@code SSL} or {@code TLS}).</td>
- *         <td>{@code TLS}</td>
- *         <td>Yes</td>
- *     </tr>
- *     <tr>
- *         <td><b>gg.client.ssl.key.algorithm</b></td>
- *         <td>Key manager algorithm.</td>
- *         <td>{@code SunX509}</td>
- *         <td>Yes</td>
- *     </tr>
- *     <tr>
- *         <td><b>gg.client.ssl.keystore.location</b></td>
- *         <td>Key store to be used by client to connect with GridGain topology.</td>
- *         <td>&nbsp;</td>
- *         <td>No (if {@code SSL} is enabled)</td>
- *     </tr>
- *     <tr>
- *         <td><b>gg.client.ssl.keystore.password</b></td>
- *         <td>Key store password.</td>
- *         <td>&nbsp;</td>
- *         <td>Yes</td>
- *     </tr>
- *     <tr>
- *         <td><b>gg.client.ssl.keystore.type</b></td>
- *         <td>Key store type.</td>
- *         <td>{@code jks}</td>
- *         <td>Yes</td>
- *     </tr>
- *     <tr>
- *         <td><b>gg.client.ssl.truststore.location</b></td>
- *         <td>Trust store to be used by client to connect with GridGain topology.</td>
- *         <td>&nbsp;</td>
- *         <td>No (if {@code SSL} is enabled)</td>
- *     </tr>
- *     <tr>
- *         <td><b>gg.client.ssl.truststore.password</b></td>
- *         <td>Trust store password.</td>
- *         <td>&nbsp;</td>
- *         <td>Yes</td>
- *     </tr>
- *     <tr>
- *         <td><b>gg.client.ssl.truststore.type</b></td>
- *         <td>Trust store type.</td>
- *         <td>{@code jks}</td>
- *         <td>Yes</td>
- *     </tr>
- *     <tr>
- *         <td><b>gg.client.credentials</b></td>
- *         <td>Client credentials used in authentication process.</td>
- *         <td>&nbsp;</td>
- *         <td>Yes</td>
- *     </tr>
- *     <tr>
- *         <td><b>gg.client.cache.top</b></td>
- *         <td>
- *             Flag indicating that topology is cached internally. Cache will be refreshed in
- *             the background with interval defined by {@code gg.client.topology.refresh}
- *             property (see below).
- *         </td>
- *         <td>{@code false}</td>
- *         <td>Yes</td>
- *     </tr>
- *     <tr>
- *         <td><b>gg.client.topology.refresh</b></td>
- *         <td>Topology cache refresh frequency (ms).</td>
- *         <td>{@code 2000}</td>
- *         <td>Yes</td>
- *     </tr>
- *     <tr>
- *         <td><b>gg.client.idleTimeout</b></td>
- *         <td>Maximum amount of time that connection can be idle before it is closed (ms).</td>
- *         <td>{@code 30000}</td>
- *         <td>Yes</td>
- *     </tr>
- * </table>
- * <h1 class="header">Example</h1>
- * <pre name="code" class="java">
- * // Register JDBC driver.
- * Class.forName("org.gridgain.jdbc.IgniteJdbcDriver");
- *
- * // Open JDBC connection.
- * Connection conn = DriverManager.getConnection("jdbc:gridgain://localhost/cache");
- *
- * // Query persons' names
- * ResultSet rs = conn.createStatement().executeQuery("select name from Person");
- *
- * while (rs.next()) {
- *     String name = rs.getString(1);
- *
- *     ...
- * }
- *
- * // Query persons with specific age
- * PreparedStatement stmt = conn.prepareStatement("select name, age from Person where age = ?");
- *
- * stmt.setInt(1, 30);
- *
- * ResultSet rs = stmt.executeQuery();
- *
- * while (rs.next()) {
- *     String name = rs.getString("name");
- *     int age = rs.getInt("age");
- *
- *     ...
- * }
- * </pre>
- */
-@SuppressWarnings("JavadocReference")
-public class IgniteJdbcDriver implements Driver {
-    /** Prefix for property names. */
-    private static final String PROP_PREFIX = "gg.jdbc.";
-
-    /** Hostname property name. */
-    static final String PROP_HOST = PROP_PREFIX + "host";
-
-    /** Port number property name. */
-    static final String PROP_PORT = PROP_PREFIX + "port";
-
-    /** Cache name property name. */
-    static final String PROP_CACHE = PROP_PREFIX + "cache";
-
-    /** Node ID URL parameter name. */
-    static final String PARAM_NODE_ID = "nodeId";
-
-    /** Node ID property name. */
-    static final String PROP_NODE_ID = PROP_PREFIX + PARAM_NODE_ID;
-
-    /** URL prefix. */
-    private static final String URL_PREFIX = "jdbc:gridgain://";
-
-    /** Default port. */
-    private static final int DFLT_PORT = 11211;
-
-    /** Major version. */
-    private static final int MAJOR_VER = 1;
-
-    /** Minor version. */
-    private static final int MINOR_VER = 0;
-
-    /**
-     * Register driver.
-     */
-    static {
-        try {
-            DriverManager.registerDriver(new IgniteJdbcDriver());
-        }
-        catch (SQLException e) {
-            throw new RuntimeException("Failed to register GridGain JDBC driver.", e);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public Connection connect(String url, Properties props) throws SQLException {
-        if (!parseUrl(url, props))
-            throw new SQLException("URL is invalid: " + url);
-
-        return new IgniteJdbcConnection(url, props);
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean acceptsURL(String url) throws SQLException {
-        return url.startsWith(URL_PREFIX);
-    }
-
-    /** {@inheritDoc} */
-    @Override public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
-        if (!parseUrl(url, info))
-            throw new SQLException("URL is invalid: " + url);
-
-        DriverPropertyInfo[] props = new DriverPropertyInfo[20];
-
-        props[0] = new PropertyInfo("Hostname", info.getProperty(PROP_HOST), true);
-        props[1] = new PropertyInfo("Port number", info.getProperty(PROP_PORT), "");
-        props[2] = new PropertyInfo("Cache name", info.getProperty(PROP_CACHE), "");
-        props[3] = new PropertyInfo("Node ID", info.getProperty(PROP_NODE_ID, ""));
-        props[4] = new PropertyInfo("gg.client.protocol", info.getProperty("gg.client.protocol", "TCP"),
-            "Communication protocol (TCP or HTTP).");
-        props[5] = new PropertyInfo("gg.client.connectTimeout", info.getProperty("gg.client.connectTimeout", "0"),
-            "Socket connection timeout.");
-        props[6] = new PropertyInfo("gg.client.tcp.noDelay", info.getProperty("gg.client.tcp.noDelay", "true"),
-            "Flag indicating whether TCP_NODELAY flag should be enabled for outgoing connections.");
-        props[7] = new PropertyInfo("gg.client.ssl.enabled", info.getProperty("gg.client.ssl.enabled", "false"),
-            "Flag indicating that SSL is needed for connection.");
-        props[8] = new PropertyInfo("gg.client.ssl.protocol", info.getProperty("gg.client.ssl.protocol", "TLS"),
-            "SSL protocol.");
-        props[9] = new PropertyInfo("gg.client.ssl.key.algorithm", info.getProperty("gg.client.ssl.key.algorithm",
-            "SunX509"), "Key manager algorithm.");
-        props[10] = new PropertyInfo("gg.client.ssl.keystore.location",
-            info.getProperty("gg.client.ssl.keystore.location", ""),
-            "Key store to be used by client to connect with GridGain topology.");
-        props[11] = new PropertyInfo("gg.client.ssl.keystore.password",
-            info.getProperty("gg.client.ssl.keystore.password", ""), "Key store password.");
-        props[12] = new PropertyInfo("gg.client.ssl.keystore.type", info.getProperty("gg.client.ssl.keystore.type",
-            "jks"), "Key store type.");
-        props[13] = new PropertyInfo("gg.client.ssl.truststore.location",
-            info.getProperty("gg.client.ssl.truststore.location", ""),
-            "Trust store to be used by client to connect with GridGain topology.");
-        props[14] = new PropertyInfo("gg.client.ssl.keystore.password",
-            info.getProperty("gg.client.ssl.truststore.password", ""), "Trust store password.");
-        props[15] = new PropertyInfo("gg.client.ssl.truststore.type", info.getProperty("gg.client.ssl.truststore.type",
-            "jks"), "Trust store type.");
-        props[16] = new PropertyInfo("gg.client.credentials", info.getProperty("gg.client.credentials", ""),
-            "Client credentials used in authentication process.");
-        props[17] = new PropertyInfo("gg.client.cache.top", info.getProperty("gg.client.cache.top", "false"),
-            "Flag indicating that topology is cached internally. Cache will be refreshed in the background with " +
-                "interval defined by topologyRefreshFrequency property (see below).");
-        props[18] = new PropertyInfo("gg.client.topology.refresh", info.getProperty("gg.client.topology.refresh",
-            "2000"), "Topology cache refresh frequency (ms).");
-        props[19] = new PropertyInfo("gg.client.idleTimeout", info.getProperty("gg.client.idleTimeout", "30000"),
-            "Maximum amount of time that connection can be idle before it is closed (ms).");
-
-        return props;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getMajorVersion() {
-        return MAJOR_VER;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getMinorVersion() {
-        return MINOR_VER;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean jdbcCompliant() {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public Logger getParentLogger() throws SQLFeatureNotSupportedException {
-        throw new SQLFeatureNotSupportedException("java.util.logging is not used.");
-    }
-
-    /**
-     * Validates and parses connection URL.
-     *
-     * @param props Properties.
-     * @param url URL.
-     * @return Whether URL is valid.
-     */
-    private boolean parseUrl(String url, Properties props) {
-        if (url == null || !url.startsWith(URL_PREFIX) || url.length() == URL_PREFIX.length())
-            return false;
-
-        url = url.substring(URL_PREFIX.length());
-
-        String[] parts = url.split("\\?");
-
-        if (parts.length > 2)
-            return false;
-
-        if (parts.length == 2)
-            if (!parseUrlParameters(parts[1], props))
-                return false;
-
-        parts = parts[0].split("/");
-
-        assert parts.length > 0;
-
-        if (parts.length > 2)
-            return false;
-
-        if (parts.length == 2 && !parts[1].isEmpty())
-            props.setProperty(PROP_CACHE, parts[1]);
-
-        url = parts[0];
-
-        parts = url.split(":");
-
-        assert parts.length > 0;
-
-        if (parts.length > 2)
-            return false;
-
-        props.setProperty(PROP_HOST, parts[0]);
-
-        try {
-            props.setProperty(PROP_PORT, String.valueOf(parts.length == 2 ? Integer.valueOf(parts[1]) : DFLT_PORT));
-        }
-        catch (NumberFormatException ignored) {
-            return false;
-        }
-
-        return true;
-    }
-
-    /**
-     * Validates and parses URL parameters.
-     *
-     * @param urlParams URL parameters string.
-     * @param props Properties.
-     * @return Whether URL parameters string is valid.
-     */
-    private boolean parseUrlParameters(String urlParams, Properties props) {
-        String[] params = urlParams.split("&");
-
-        for (String param : params) {
-            String[] pair = param.split("=");
-
-            if (pair.length != 2 || pair[0].isEmpty() || pair[1].isEmpty())
-                return false;
-
-            props.setProperty(PROP_PREFIX + pair[0], pair[1]);
-        }
-
-        return true;
-    }
-
-    /**
-     * Extension of {@link DriverPropertyInfo} that adds
-     * convenient constructors.
-     */
-    private static class PropertyInfo extends DriverPropertyInfo {
-        /**
-         * @param name Name.
-         * @param val Value.
-         */
-        private PropertyInfo(String name, String val) {
-            super(name, val);
-        }
-
-        /**
-         * @param name Name.
-         * @param val Value.
-         * @param desc Description.
-         */
-        private PropertyInfo(String name, String val, String desc) {
-            super(name, val);
-
-            description = desc;
-        }
-
-        /**
-         * @param name Name.
-         * @param val Value.
-         * @param required Required flag.
-         */
-        private PropertyInfo(String name, String val, boolean required) {
-            super(name, val);
-
-            this.required = required;
-        }
-
-        /**
-         * @param name Name.
-         * @param val Value.
-         * @param desc Description.
-         * @param required Required flag.
-         */
-        private PropertyInfo(String name, String val, String desc, boolean required) {
-            super(name, val);
-
-            description = desc;
-            this.required = required;
-        }
-    }
-}


Mime
View raw message