[hg] main-silver: #204942: Cannot find org.apache.derby.catalog....

  • From: Jaroslav Havlin < >
  • To:
  • Subject: [hg] main-silver: #204942: Cannot find org.apache.derby.catalog....
  • Date: Fri, 04 Jan 2013 08:58:30 -0800

changeset 2c1bd76ed25c in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/2c1bd76ed25c
description:
        #204942: Cannot find org.apache.derby.catalog.types.RoutineAliasInfo

diffstat:

 derby/src/org/netbeans/modules/derby/DerbyOptions.java |  21 
++++++++++++------
 1 files changed, 14 insertions(+), 7 deletions(-)

diffs (53 lines):

diff --git a/derby/src/org/netbeans/modules/derby/DerbyOptions.java 
b/derby/src/org/netbeans/modules/derby/DerbyOptions.java
--- a/derby/src/org/netbeans/modules/derby/DerbyOptions.java
+++ b/derby/src/org/netbeans/modules/derby/DerbyOptions.java
@@ -275,8 +275,10 @@
             FileUtil.runAtomicAction(new FileSystem.AtomicAction() {
                 @Override
                 public void run() {
-                    registerDriver(DRIVER_NAME_NET, DRIVER_DISP_NAME_NET, 
DRIVER_CLASS_NET, DRIVER_PATH_NET, newLocation);
-                    registerDriver(DRIVER_NAME_EMBEDDED, 
DRIVER_DISP_NAME_EMBEDDED, DRIVER_CLASS_EMBEDDED, DRIVER_PATH_EMBEDDED, 
newLocation);
+                    registerDriver(DRIVER_NAME_NET, DRIVER_DISP_NAME_NET, 
DRIVER_CLASS_NET,
+                            new String[]{DRIVER_PATH_NET, 
DRIVER_PATH_EMBEDDED}, newLocation);
+                    registerDriver(DRIVER_NAME_EMBEDDED, 
DRIVER_DISP_NAME_EMBEDDED,
+                            DRIVER_CLASS_EMBEDDED, new 
String[]{DRIVER_PATH_EMBEDDED}, newLocation);
                 }
             });
         } catch (IOException e) {
@@ -284,7 +286,7 @@
         }
     }
 
-    private static void registerDriver(String driverName, String 
driverDisplayName, String driverClass, String driverRelativeFile, String 
newLocation) {
+    private static void registerDriver(String driverName, String 
driverDisplayName, String driverClass, String[] driverRelativeFile, String 
newLocation) {
         // try to remove the driver first if it exists was registered from 
the current location
         JDBCDriver[] drivers = 
JDBCDriverManager.getDefault().getDrivers(driverClass);
         for (int i = 0; i < drivers.length; i++) {
@@ -336,10 +338,16 @@
 
         // register the new driver if it exists at the new location
         if (newLocation != null && newLocation.length() >= 0) {
-            File newDriverFile = new File(newLocation, driverRelativeFile);
-            if (newDriverFile.exists()) {
+            URL[] driverFileUrls = new URL[driverRelativeFile.length];
                 try {
-                    JDBCDriver newDriver = JDBCDriver.create(driverName, 
driverDisplayName, driverClass, new URL[] { newDriverFile.toURI().toURL() });
+                for (int i = 0; i < driverRelativeFile.length; i++) {
+                    File drvFile = new File(newLocation, 
driverRelativeFile[i]);
+                    if (!drvFile.exists()) {
+                        return;
+                    }
+                    driverFileUrls[i] = drvFile.toURI().toURL();
+                }
+                JDBCDriver newDriver = JDBCDriver.create(driverName, 
driverDisplayName, driverClass, driverFileUrls);
                     JDBCDriverManager.getDefault().addDriver(newDriver);
                 } catch (MalformedURLException e) {
                     LOGGER.log(Level.WARNING, null, e);
@@ -348,7 +356,6 @@
                 }
             }
         }
-    }
 
     private void registerLibrary(final String newLocation) {
         final FileObject libsFolder = FileUtil.getConfigFile(

[hg] main-silver: #204942: Cannot find org.apache.derby.catalog....

Jaroslav Havlin 01/04/2013

Project Features

About this Project

DB was started in November 2009, is owned by Antonin Nebuzelsky, and has 113 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close