Page 1 of 1
PHP - Java Integration
Posted: Wed May 30, 2007 8:29 am
by Ansh
I have done a program of PHP - java integration and is working fine. But i couldn't connect to 'MYsql' databse through this method. its giving an error " java.sql.SQLException: No suitable driver" . But my java program which calls the databse driver will work fine, if i execute through command prompt. So it is not a problem of classpath and url.
Should i set anything in php.ini file to get it work for database connection?
Please help.
Regards
Ansh
Posted: Wed May 30, 2007 8:33 am
by superdezign
Doesn't sound like a PHP problem. Sounds like Java.
Posted: Wed May 30, 2007 9:13 am
by victorsk
If it's a servlet try to add your mysql jar to WEB-INF/classes directory.
Posted: Wed May 30, 2007 11:41 pm
by Ansh
Thanking you for the reply.

I think Its not the problem of java program [s]bcoz[/s]
because its working in command prompt. This is a simple database connection program. not a servelt also.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.
Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.
Posted: Thu May 31, 2007 7:28 am
by superdezign
Ansh wrote:Thanking you for the reply.

I think Its not the problem of java program [s]bcoz[/s]
because its working in command prompt. This is a simple database connection program. not a servelt also.
Well, it's certainly not PHP. PHP doesn't have control over/access to Java classes, which I'm assuming that java.sql is.
Are you sure it's not an issue of MySQL?