Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Execute Java from PHP (Classpath problem?)

843785Nov 13 2008 — edited Nov 13 2008
Hi,

I'm trying to execute a java application (just a few classes really), using PHP (so the app can be executed by the click of a button on a webpage). It is an Apache server running on windows.

The code to execute the java from the webpage is as follows...
<?php
echo "<pre>> EXECUTING...</pre>";
$output = shell_exec('java UpdateStock');
echo "<pre>$output</pre>";
?>
However, I get this error.
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
The class runs fine from the command line (it's all setup using the typical classpath method), so I suspect its something to do with the server's configuration and not being able to find the drivers. How do I point the server-based app to the mysql drivers?

Many thanks for your help

Edited by: chezza on Nov 13, 2008 3:04 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 11 2008
Added on Nov 13 2008
10 comments
745 views