[ 
https://issues.apache.org/jira/browse/KYLIN-2668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16361863#comment-16361863
 ] 

ASF GitHub Bot commented on KYLIN-2668:
---------------------------------------

yiming187 closed pull request #61: Fix for KYLIN-2668
URL: https://github.com/apache/kylin/pull/61
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/jdbc/src/main/java/org/apache/kylin/jdbc/KylinConnection.java 
b/jdbc/src/main/java/org/apache/kylin/jdbc/KylinConnection.java
index 6852998961..61d13b9abd 100644
--- a/jdbc/src/main/java/org/apache/kylin/jdbc/KylinConnection.java
+++ b/jdbc/src/main/java/org/apache/kylin/jdbc/KylinConnection.java
@@ -51,7 +51,7 @@ protected KylinConnection(UnregisteredDriver driver, 
KylinJdbcFactory factory, S
         super(driver, factory, url, info);
 
         String odbcUrl = url;
-        odbcUrl = odbcUrl.replace(Driver.CONNECT_STRING_PREFIX + "//", "");
+        odbcUrl = odbcUrl.replaceAll((Driver.CONNECT_STRING_PREFIX + 
"[[A-Za-z0-9]*=[A-Za-z0-9]*;]*//").toString(), "");
         String[] temps = odbcUrl.split("/");
 
         assert temps.length == 2;
diff --git a/jdbc/src/test/java/org/apache/kylin/jdbc/DriverTest.java 
b/jdbc/src/test/java/org/apache/kylin/jdbc/DriverTest.java
index 08876349cb..255cb76bee 100644
--- a/jdbc/src/test/java/org/apache/kylin/jdbc/DriverTest.java
+++ b/jdbc/src/test/java/org/apache/kylin/jdbc/DriverTest.java
@@ -189,6 +189,14 @@ public void testPreparedStatementWithCubeData() throws 
SQLException {
         conn.close();
     }
 
+     @Test
+    public void testSSLFromURL() throws SQLException{
+        Driver driver = new DummyDriver();
+        Connection conn = 
driver.connect("jdbc:kylin:ssl=True;//test_url/test_db", null);
+        assertEquals("test_url", ((KylinConnection)conn).getBaseUrl());
+        assertEquals("test_db", ((KylinConnection)conn).getProject());
+    }        
+
     private void printResultSet(ResultSet rs) throws SQLException {
         ResultSetMetaData meta = rs.getMetaData();
         System.out.println("Data:");


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Support Calcites Properties in JDBC URL
> ---------------------------------------
>
>                 Key: KYLIN-2668
>                 URL: https://issues.apache.org/jira/browse/KYLIN-2668
>             Project: Kylin
>          Issue Type: Improvement
>          Components: Driver - JDBC
>    Affects Versions: 1.x-HBase1.1.3
>            Reporter: Joe Swingle
>            Assignee: Joe Swingle
>            Priority: Major
>             Fix For: v2.1.0
>
>         Attachments: KYLIN-2668-v2.patch
>
>
> We currently access our OLAP Cubes in Kylin from our BI Tool over JDBC.  We 
> run Kylin over SSL.  When using our COTS BI Tool, we cannot programmatically 
> pass in property values such as ssl=True into a java.util.Properties.   We 
> can only specify a Username, Password and URL.
> According to Calcite we should be able to provide some properties in the JDBC 
> URL.  Line 142 of org.apache.calcite.avatica.UnregisteredDriver, builds java 
> properties based on the URL.   This works for Kylin.  For example, 
> "jdbc:kylin:ssl=True;//kylinserver.com/Projectname"   Will correctly 
> establish the connection as using SSL.
> The problem is in KylinConnection's Constructor.  It splits the jdbcURL on 
> "jdbc:kylin://".  So, it ignores the SSL. (KylinConnection.  Line 54-60.)
> The KylinConnection needs to be updated to support this method for setting 
> properties, so it can be used by 3rd party applications where programing the 
> connection is not possible.
> We have coded this locally, and will submit patch.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to