|
From: <php...@li...> - 2009-01-22 15:37:15
|
Hi Jost, > How can I use the PHP-Java Bridge to connect PHP to MySQL > using the JNDI connection? >> Please see the MySQL API for details. An example is here: >> http://dev.mysql.com/doc/refman/5.0/en/connector-j-usagenotes-basic.html#connector-j-examples-connection-drivermanager This example is in Java. So I assume that I must create the connection in Java, and then call this script from PHP? How can I call it from PHP? > $dbh = mysql_connect("java:comp/env/jdbc/TestDB") >> Mamma mia... :) If you want to access the driver from a EJB session bean, please see our EJB example (http://php-java-bridge.sourceforge.net/pjb/examples/source.php?source=documentClient.php) how to access a session bean. In this example, would I first need to setup and code an EJB in Java that creates the database connection? I'm using Tomcat, so does this mean I have to use openEJB? Once I have the EJB, do I just call it from PHP using the code example you provided? regards Jp This message has been scanned for viruses by MailControl - www.mailcontrol.com |