You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "jhorvath (via GitHub)" <gi...@apache.org> on 2023/01/26 14:41:59 UTC

[GitHub] [netbeans] jhorvath commented on a diff in pull request #5363: Proper escaping of TNS_ADMIN path. Select JDBC driver with defined implementation.

jhorvath commented on code in PR #5363:
URL: https://github.com/apache/netbeans/pull/5363#discussion_r1087937860


##########
enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/actions/DownloadWalletAction.java:
##########
@@ -105,7 +110,22 @@ public void actionPerformed(ActionEvent ev) {
                 if (p.getDbUser() != null && p.getDbPassword() != null) {
                     
                     JDBCDriver[] drivers = JDBCDriverManager.getDefault().getDrivers("oracle.jdbc.OracleDriver"); //NOI18N
+                    JDBCDriver jarsPresent = null;
+                    
                     if (drivers.length > 0) {
+                        
+                        // prefer a driver that actually defines some JARs.
+                        for (JDBCDriver d : drivers) {
+                            if (isAvailable(d)) {
+                                jarsPresent = d;
+                                break;
+                            }
+                        }
+                        if (jarsPresent == null) {
+                            jarsPresent = drivers[0];
+                            // PENDING: should be shown to the user ?
+                            LOG.log(Level.WARNING, "Unable to find driver JARs for wallet {0}, using fallback driver: {1}", new Object[] { walletPath, jarsPresent.getName() });
+                        }

Review Comment:
   Shouldn't we display message that the driver is not installed here? Driver with no jars is useless here.  



-- 
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@netbeans.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists