|
From: <php...@li...> - 2009-02-12 08:11:41
|
Brilliant,
I got it working with the above examples.
I have some questions regarding PDO. Would it be possible to use PDO with the Java Bridge? For example:
$pdo = new PDO("jdbc:mysql://localhost/test", "user", "pass");
I've tested this but I get the Tomcat error:
javax.servlet.ServletException: java.lang.RuntimeException: PHP Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in /home/tomcat/webapps/JavaBridge/bridge_test2.php:9
Stack trace:
#0 /home/tomcat/webapps/JavaBridge/bridge_test2.php(9): PDO->__construct('jdbc:mysql://local...', 'test, 'test')
#1 {main}
thrown in /home/tomcat/webapps/JavaBridge/bridge_test2.php on line 9
php.java.servlet.PhpCGIServlet.handle(PhpCGIServlet.java:384)
php.java.servlet.CGIServlet.doGet(CGIServlet.java:470)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
I am not sure if I require any different kind of java code / driver loading apart from:
# load driver from java.ext.dirs using Class.forName(...)
new java("com.mysql.jdbc.Driver");
Can PDO work in this way with the Bridge? Are there any examples available?
Also, is it possible to use the Bridge to call JNDI directly via PDO, such as (this works in Quercus):
$pdo = new PDO("java:comp/env/jdbc/TestDB");
Any help much appreciated.
kind regards
This message has been scanned for viruses by MailControl - www.mailcontrol.com
|