You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by GitBox <gi...@apache.org> on 2020/01/06 20:23:29 UTC

[GitHub] [knox] smolnar82 commented on a change in pull request #231: KNOX-2128 - Custom DataSource and SQL Commands for KnoxShell and KnoxShellTable

smolnar82 commented on a change in pull request #231: KNOX-2128 - Custom DataSource and SQL Commands for KnoxShell and KnoxShellTable
URL: https://github.com/apache/knox/pull/231#discussion_r363466832
 
 

 ##########
 File path: gateway-shell/src/main/java/org/apache/knox/gateway/shell/table/JDBCKnoxShellTableBuilder.java
 ##########
 @@ -109,12 +107,15 @@ public KnoxShellTable sql(String sql) throws IOException, SQLException {
     return this.table;
   }
 
-  private Connection createConnection() throws SQLException {
-    if (StringUtils.isNotBlank(username) && pass != null) {
-      return DriverManager.getConnection(connectionUrl, username, pass);
-    } else {
-      return DriverManager.getConnection(connectionUrl);
+  public Connection createConnection() throws SQLException {
+    Connection con = null;
+    if (username != null && pass != null) {
+      con = DriverManager.getConnection(connectionUrl, username, pass);
+    }
+    else {
+      con = DriverManager.getConnection(connectionUrl);
     }
+    return con;
 
 Review comment:
   The `public` visibility is an issue with how AspectJ is configured as of now. If this goes in, I need to figure out how to make it work. I haven't checked it yet, but package-private would not be enough?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services