Mantis - Quercus
Viewing Issue Advanced Details
3011 feature always 10-19-08 21:47 10-27-08 20:52
ckchris  
 
normal  
new 3.1.8  
open  
none    
none  
0003011: Feature Request for DB connect strings
This is rather trivial, but some PHP applications use the mysql_connect($host, $user, $password, $dbname) method call to connect to the database. The web application form will then ask for this information and doesn't provide you a way to specify a JNDI datasource to use. Thus, when you enter the JNDI datasource as the $host, connection will fail from the Quercus side.

It's true that it's easy to just change the mysql_connect in the PHP file to use the one-argument mysql_connect version. However, since this is specifically a Quercus PHP-Java bridging edge case, I think it may not be a bad idea to have Quercus check for the following edge case in mysql_connect function:

*) If mysql_connect($host,$user,$password,$dbname) is used AND the $host is a JNDI string that starts with "java:", then ignore all the rest of the parameters and accept this as a JNDI string.

I think this will make Quercus even more compatible with existing php apps without having to modify any source files.

Notes
(0003519)
ckchris   
10-27-08 20:52   
I just realized that mysql_connect() does not accept a JNDI URL to connect using the JNDI.

Quercus documentation at :

http://www.caucho.com/resin/doc/quercus.xtp#databases [^]

specifies that you can use mysql_connect(<jndi_string>) to connect. I tried it and it doesn't work. I checked quercus source code and it doesn't look like this is even supported.

So what's the primary verdict here? The documentation is misleading.