|
From: <php...@li...> - 2009-01-20 11:25:26
|
Hi there,
I have deployed the JavaBridge war file into my Tomcat backend.
I have successfully connected JSP to MySQL using MySQL Connector / J using JNDI (which is configured in the Tomcat server.xml and web.xml files).
How can I use the PHP-Java Bridge to connect PHP to MySQL using the JNDI connection?
I have tried this PHP code to call the JNDI connection jdbc/TestDB:
<?php
require_once("java/Java.inc");
$dbh = mysql_connect("java:comp/env/jdbc/TestDB")
?>
But i receive the error:
Warning - mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Unknown MySQL server host 'java' (1)
Is what I am trying to achieve possible with the PHP-Java Bridge? Do I need to require more than the java/Java.inc file in my code?
If you could you supply me with or point me to the correct code to achieve this connection I would be most grateful.
Kind regards
This message has been scanned for viruses by MailControl - www.mailcontrol.com
|