From: <php...@li...> - 2011-10-13 14:27:20
|
Hi... Can someone provide me some advise on best practices for the use of jdbc connection resources in the hosted JVM. I want to call java code that performs jdbc from a php-developed web application. I am concerned about the JVM not releasing connections. Also, is it practical (or possible) to keep jdbc connections open during php sessions? Is this advised? Thanks, Tony |
From: <php...@li...> - 2011-10-13 14:51:37
|
Hi Tony, Using the Java Bridge as a JDBC wrapper incurs a fair amount of technical overhead to your project. If at all possible, I would encourage you to first look for a suitable ODBC driver so that way you can natively access the driver within PHP. But if JDBC is your only option, it can be done. I've used the bridge on a Linux host to connect to SQL Server by JDBC and everything seemed to work OK. I did not go much further than executing some queries and iterating result sets, but it worked pretty quickly on an idle dev server. As far as your connection questions go: You can explicitly shut down any open database connections by calling the close() method on the JDBC driver. But I have no idea if you can keep a persistent connection open across multiple PHP script executions.. Like I said, I was mostly playing around just to see what could be done. It was very quick, but I don't know how well it performs under load. Good luck! Brandon Kirsch bra...@gm... http://perceptionilluminates.com On Thu, Oct 13, 2011 at 10:27 AM, <php...@li...> wrote: > Hi... > > Can someone provide me some advise on best practices for the use of jdbc > connection resources in the hosted JVM. > > I want to call java code that performs jdbc from a php-developed web > application. I am concerned about the JVM not > releasing connections. Also, is it practical (or possible) to keep jdbc > connections open during php sessions? Is this advised? > > Thanks, > Tony > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure contains a > definitive record of customers, application performance, security > threats, fraudulent activity and more. Splunk takes this data and makes > sense of it. Business sense. IT sense. Common sense. > http://p.sf.net/sfu/splunk-d2d-oct > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > |
From: <php...@li...> - 2011-10-13 15:03:54
|
Thanks Brandon for the quick response! I should have provided more details...I am using yet another open source java component for which I need to leverage its core functionality. However the component requires jdbc connection information to initialize. It is this component's functionality that I really need to access from PHP. I don't know, nor concerned how it is performing its work...I am interested in its results but want it to be efficient. I am wanting to know the rules for working with the PHP-JAVA bridge component when the java code to be called will have reusable resources like opening files or jdbc connections. Thanks, Tony On Thu, Oct 13, 2011 at 10:51 AM, < php...@li...> wrote: > Hi Tony, > Using the Java Bridge as a JDBC wrapper incurs a fair amount of > technical overhead to your project. If at all possible, I would > encourage you to first look for a suitable ODBC driver so that way you > can natively access the driver within PHP. > > But if JDBC is your only option, it can be done. I've used the bridge > on a Linux host to connect to SQL Server by JDBC and everything seemed > to work OK. I did not go much further than executing some queries and > iterating result sets, but it worked pretty quickly on an idle dev > server. > > As far as your connection questions go: You can explicitly shut down > any open database connections by calling the close() method on the > JDBC driver. But I have no idea if you can keep a persistent > connection open across multiple PHP script executions.. Like I said, I > was mostly playing around just to see what could be done. It was very > quick, but I don't know how well it performs under load. > > Good luck! > > Brandon Kirsch > bra...@gm... > http://perceptionilluminates.com > > > On Thu, Oct 13, 2011 at 10:27 AM, > <php...@li...> wrote: > > Hi... > > > > Can someone provide me some advise on best practices for the use of jdbc > > connection resources in the hosted JVM. > > > > I want to call java code that performs jdbc from a php-developed web > > application. I am concerned about the JVM not > > releasing connections. Also, is it practical (or possible) to keep jdbc > > connections open during php sessions? Is this advised? > > > > Thanks, > > Tony > > > ------------------------------------------------------------------------------ > > All the data continuously generated in your IT infrastructure contains a > > definitive record of customers, application performance, security > > threats, fraudulent activity and more. Splunk takes this data and makes > > sense of it. Business sense. IT sense. Common sense. > > http://p.sf.net/sfu/splunk-d2d-oct > > _______________________________________________ > > php-java-bridge-users mailing list > > php...@li... > > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > > > > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure contains a > definitive record of customers, application performance, security > threats, fraudulent activity and more. Splunk takes this data and makes > sense of it. Business sense. IT sense. Common sense. > http://p.sf.net/sfu/splunk-d2d-oct > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > |
From: <php...@li...> - 2011-10-15 13:22:00
|
Hi, => http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html#JDBC_Data_Sources BTW: Our JNDI example at http://php-java-bridge.sourceforge.net/pjb/examples/source.php?source=documentClient.phpuses an obsolete syntax. Instead of javax_naming_InitialContext it should be javax\naming\InitialContext (php >=5.3) or java("javax.naming.InitialContext")->($serverArgs) (php4) Regards, Jost Bökemeier |
From: <php...@li...> - 2011-10-16 01:45:33
|
Thanks Jost...exactly what I was looking for... Thanks, Tony On Sat, Oct 15, 2011 at 9:21 AM, < php...@li...> wrote: > Hi, > > => > > http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html#JDBC_Data_Sources > > BTW: Our JNDI example at > > http://php-java-bridge.sourceforge.net/pjb/examples/source.php?source=documentClient.phpuses > an obsolete syntax. > > Instead of javax_naming_InitialContext it should be > javax\naming\InitialContext (php >=5.3) or > java("javax.naming.InitialContext")->($serverArgs) (php4) > > > Regards, > Jost Bökemeier > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure contains a > definitive record of customers, application performance, security > threats, fraudulent activity and more. Splunk takes this data and makes > sense of it. Business sense. IT sense. Common sense. > http://p.sf.net/sfu/splunk-d2d-oct > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > |