Hi,
I'm currently trying to port Sonar (sonar.codehaus.org) to PostgreSQL and I have a small problem I can't fix by myself.
Sonar is using JNDI and is database agnostic so the driver isn't set in database.yml.
With PostgreSQL, it leads to an error in the following line in the configure_jndi method of jdbc_adapter.rb:
@config[:driver] = connection.meta_data.connection.java_class.name
connection.meta_data.connection is OK but connection.meta_data.connection.java_class raises the following exception:
wrong # of arguments(0 for 1)
Even if this problem is solved, I still think this line is wrong because connection.meta_data.connection returns
a org.postgresql.jdbc3.Jdbc3Connection object which isn't the driver class (the driver class for PostgreSQL is
org.postgresql.Driver).
Everything is fine if I configure the driver in database.yml but I'd really like to avoid that.
Shouldn't we try to call DriverManager.getDriver(connection.getMetaData().getURL()).getName() to get the real driver
name?
Any comment or help on how to fix this problem?
Thanks in advance.
--
Guillaume |