ignite-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [ignite-3] AMashenkov commented on a change in pull request #284: IGNITE-15186 Implement basic JDBC client: Statement, ResultSet
Date Tue, 14 Sep 2021 09:00:36 GMT

AMashenkov commented on a change in pull request #284:
URL: https://github.com/apache/ignite-3/pull/284#discussion_r708064507



##########
File path: modules/client/src/main/java/org/apache/ignite/jdbc/IgniteJdbcDriver.java
##########
@@ -0,0 +1,124 @@
+/*
+ * 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.Connection;
+import java.sql.Driver;
+import java.sql.DriverManager;
+import java.sql.DriverPropertyInfo;
+import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+import java.util.Properties;
+import java.util.logging.Logger;
+import org.apache.ignite.client.proto.ProtocolVersion;
+import org.apache.ignite.internal.jdbc.ConnectionPropertiesImpl;
+import org.apache.ignite.internal.jdbc.JdbcConnection;
+
+import static org.apache.ignite.internal.jdbc.ConnectionPropertiesImpl.URL_PREFIX;
+
+/**
+ * JDBC driver thin implementation for In-Memory Data Grid.
+ * <p>
+ * Driver allows to get distributed data from Ignite cache using standard
+ * SQL queries and standard JDBC API. It will automatically get only fields that
+ * you actually need from objects stored in cache.
+ */
+public class IgniteJdbcDriver implements Driver {
+    /** Driver instance. */
+    private static final Driver INSTANCE = new IgniteJdbcDriver();
+
+    /** Registered flag. */
+    private static volatile boolean registered;
+
+    static {
+        register();
+    }

Review comment:
       Let's create a ticket for this minor improvement.
   I believe all is needed is to add classname to META_INF/services/java.sql.Driver file.
   
   Ok, tests may require manual driver registration as you do, e.g. in Test.beforeClass method.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message