Mantis - Quercus
Viewing Issue Advanced Details
2753 minor always 06-27-08 07:11 08-07-08 16:37
ferg  
ferg  
normal  
closed 3.1.6  
fixed  
none    
none 3.2.0  
0002753: postgres driver
(rep by atijms )

I was trying to get a DB connection to a PostgreSQL DB from PHP using Quercus. Without configuring a JDNI datasource, Quercus attempts to instantiate the postgresql driver (org.postgresql.Driver). However, a while later Quercus.findDatabase tries to cast this into a javax.sql.Datasource. Of course this always fails, since org.postgresql.Driver does not implement this interface.

The offending line seems to be in PostgresModule, line 276:


String driver = "org.postgresql.Driver";
String url = "jdbc:postgresql://" [^] + host + ":" + port + "/" + dbName;

Postgres postgres = new Postgres(env, host, userName, password, dbName, port, driver, url);
Which eventually leads to a call in Quercus.java, line 444:


Class cls = loader.loadClass(driver);

return (DataSource)cls.newInstance();
So it seems like PostgresModule should not be providing "org.postgresql.Driver" as the driver name, right?


Notes
(0003301)
ferg   
08-07-08 16:37   
php/43s0