This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 83144 - Detect and use JavaDB drivers if running on Java 6
Summary: Detect and use JavaDB drivers if running on Java 6
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Derby (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords:
: 101433 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-08-22 09:46 UTC by Petr Jiricka
Modified: 2007-09-12 13:31 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2006-08-22 09:46:43 UTC
When the IDE is running on Java 6, we should use the JavaDB database bundled
with Java 6 and make it available to NetBeans users, in the following ways:

- add the Derby/JavaDB drivers to the Databases node in the Runtime tab
- add the Derby/JavaDB drivers to the Library Manager (so Derby they can be
easily used in Java SE applications)
- install the sample Derby database that we bundle in the IDE and register the
corresponding connection in the Databases node in the Runtime tab
Comment 1 Andrei Badea 2006-11-22 14:09:20 UTC
As of November 20 the Java DB instance bundled with JDK 6 is detected and the
drivers are registered in the Runtime tab. 

Adding the drivers to the Library Manager is a larger issue, as it doesn't only
apply to Derby, but to all databases.
Comment 2 Andrei Badea 2006-11-26 17:26:05 UTC
Also registering the sample database when a Java DB instance was detected.

Checking in src/org/netbeans/modules/derby/Bundle.properties;
/cvs/db/derby/src/org/netbeans/modules/derby/Bundle.properties,v  <-- 
Bundle.properties
new revision: 1.18; previous revision: 1.17
done
Checking in src/org/netbeans/modules/derby/Installer.java;
/cvs/db/derby/src/org/netbeans/modules/derby/Installer.java,v  <--  Installer.java
new revision: 1.2; previous revision: 1.1
done
Checking in src/org/netbeans/modules/derby/api/DerbyDatabases.java;
/cvs/db/derby/src/org/netbeans/modules/derby/api/DerbyDatabases.java,v  <-- 
DerbyDatabases.java
new revision: 1.3; previous revision: 1.2
done
Comment 3 Petr Jiricka 2006-12-01 17:17:51 UTC
I just saw that JDK 6 also contains a sample database toursdb under:
db/demo/databases

See also:
http://wiki.netbeans.org/wiki/view/JavaDBMustang

It would be useful to automatically register this database as well.
Comment 4 Andrei Badea 2007-01-31 15:09:24 UTC
The bundled Java DB will be installed in various locations in JDK 6 update 2:

1. /opt/SUNWjavadb on Solaris package (SVR4) based installs
2. /opt/sun/javadb on Linux package (RPM) based installs
3. C:\Program Files\Sun\JavaDB (or the local equivalent)
   on Windows
4. $JDK_HOME/db for file based installs (same as today)

Will need to check all these locations (currently only #4 is checked).
Comment 5 _ jimdavidson 2007-01-31 17:32:00 UTC
Note that whenever Apple ships a corresponding version of the JDK (Java SE 6 is
still in Developer Preview), they may install JavaDB in yet another location.
Comment 6 David Vancouvering 2007-07-11 17:43:56 UTC
This is important to do, it goes against user expectations.  It should be registered automatically
Comment 7 Andrei Badea 2007-07-16 14:19:18 UTC
*** Issue 101433 has been marked as a duplicate of this issue. ***
Comment 8 Andrei Badea 2007-07-25 13:26:47 UTC
Still leaving open, need to test on Windows.

Checking in src/org/netbeans/modules/derby/JDKDerbyHelper.java;
/cvs/db/derby/src/org/netbeans/modules/derby/JDKDerbyHelper.java,v  <--  JDKDerbyHelper.java
new revision: 1.3; previous revision: 1.2
done
Comment 9 Andrei Badea 2007-07-31 13:16:16 UTC
Using System.getenv() to get an environment propery instead of System.getProperty("Env-FOO"). With this change Java DB
is detected correctly on Windows.

Checking in src/org/netbeans/modules/derby/JDKDerbyHelper.java;
/cvs/db/derby/src/org/netbeans/modules/derby/JDKDerbyHelper.java,v  <--  JDKDerbyHelper.java
new revision: 1.4; previous revision: 1.3
done
Comment 10 Andrei Badea 2007-07-31 13:24:50 UTC
Still waiting for the final decision on the location of Java DB in the file-based JDK distributions, so downgrading to
P3 and leaving open.
Comment 11 John Baker 2007-09-06 05:52:55 UTC
I believe the fix mentioned in desc10 is not quite correct.

We should assign Java DB settings to use the Java DB installed by Java 6 only if the IDE is using Java 6.

My opinion is we should only use settings "known" by the IDE.
Comment 12 Andrei Badea 2007-09-10 15:32:11 UTC
You are right, will fix for 6.0.
Comment 13 Andrei Badea 2007-09-12 13:29:41 UTC
Fixed the problem in desc12.

Checking in src/org/netbeans/modules/derby/JDKDerbyHelper.java;
/cvs/db/derby/src/org/netbeans/modules/derby/JDKDerbyHelper.java,v  <--  JDKDerbyHelper.java
new revision: 1.5; previous revision: 1.4
done
Comment 14 Andrei Badea 2007-09-12 13:31:07 UTC
The current state is compliant with JDK 6 update 3, so closing.