From: <php...@li...> - 2009-02-12 12:59:14
|
Hi, > I have some questions regarding PDO. Would it be possible > to use PDO with the Java Bridge? You don't need the PHP/Java Bridge if all you want is to access databases through PHP PDO. However, if you have a PDO library written in pure Java, you can access this library through the PHP/Java Bridge. > 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"); Just copy the Java .jar file which exports the PDO API (quercus.jar probably) to your WEB-INF/lib and use the class as usual: $pdo = new java("com.caucho.xxx.pdo", "java:comp/env/jdbc/TestDB"); There's a test in the tests.php5 folder which accesses quercus from PHP through the PHP/Java Bridge, so this should work. However, why do you want to use PHP PDO if you can use the pure Java JDBC API? Regards, Jost Boekemeier |