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.
I want to use JRuby and Rails in an application built with NetBeans 6. Most of this is easy -- until I tried to use a Postgres based database. Then, I encountered the error that org.postgresql.Driver could not be loaded. There are actually two different issues here, both of which count as bugs in my book. * If you right click on the project, select Set Configuration --> Customize and category "Java", you can click "Add JAR/Folder" and manually point at the driver JAR file (although the Mac finder dialog makes this impossible if you want to use the copy embedded inside NB itself). However, this approach has a fatal flaw -- it updates "nbproject/project.properties" with a path that is local to my own development environment, and will create a mess if I check this file into an SCM system (very typical for shared developer environments). Any such settings should be saved in the "nbproject/private" directory. * The only other way I could find to make this work at all was to manually copy (or symlink) the Postgres JDBC driver jar into the "lib" directory of the embedded copy of JRuby in use. This is very bad, given the lack of GUI support for the operation, and the fact that symlinks do not exist on Windows so it leads to a proliferation of copies of the JAR file. A "best practices" approach would be to provide a way for the developer to: * Manage a set of JAR files (or directories) that are implicitly added to the class path for *all* Ruby projects. Or, dreaming big time, a way to set up "profiles" of sets of things that could be selected by set-name for a project, instead of individually. * Persist the data behind these choices in nbproject/private, since the paths will be unique to a particular developer. (Alternatively, an analog to the way that NB supports "library dependency projects" in the Java world would be even better.) * Some way to share the set of references that a Ruby project requires so that other developers can be guided through the required configuration steps to make the necessary JAR files available. The library dependency project approach would make lots of sense here.
I believe this is a P2 because (a) the workaround is ugly and (b) PotsgreSQL support is important to Solaris/Database strategy, even though one could argue it's not important because there are few PostgreSQL users. This is something we hope to change, and making PostgreSQL hard to access doesn't encourage that to happen.
Note that this issue is not restricted to just adding a Postgres JDBC driver. The same problem occurs if you want to add *any* Java class library in a way that causes it to show up in the classpath seen by JRuby.
I'll have a look at this. Related to this is http://wiki.netbeans.org/wiki/view/OutOfBoxVersionabilityProposal.
The PostgreSQL drivers (and other JDBC drivers) are now automatically added to the class path, please see http:// wiki.netbeans.org/RubyDatabaseIntegration for more info. Note that a reference to project.properties is only added if the referenced file could be referenced using a relative path, otherwise the reference is put to private.properties - this applies also to any JAR file added through the project customizer. It is still not ideal, but considering all this, I think the issue can be downgraded to P3.
I think we can close this once issue 138316 is fixed.
Closing now that issue 138316 is fixed, the drivers and active record jdbc adapters for mysql and postgresql are now bundled with the IDE.