I have some problem with accessing API using PHP. Here is the story :I use PHP as my main script on my webserver.I want to retrieve data in database server (oversea).The database hệ thống provides API & it"s available to lớn download.So I tải về the API but dont know how to use it....:(oh yes, the API is bundled in .jar file. There are example files but all of them are written in java và there are something about java rmi etc....
Bạn đang xem: How it works, how to use php api in java
please help me to lớn find a way to lớn retrieve data from the database. Can i use API? how to use it? is it possible for PHP to gọi API written on java
Thank you very much
No, but you could use JSP...
Jump lớn PostOr write a Java program that runs constantly and can communicate in some way (probably through SOAP) with your PHP application & use that as middleware.
But indeed, moving khổng lồ a JSP/Servlet environment is the best option by far.
Jump to lớn PostNo, but you could use JSP...
Or write a Java program that runs constantly và can communicate in some way (probably through SOAP) with your PHP application and use that as middleware.
But indeed, moving to lớn a JSP/Servlet environment is the best option by far.
Thank you very much for the replies.....I already setting up the apache using php_java bridge & it works well (the PHP can access all java class, such as java.lang etc).....
yes, write java application và php connect to the java application could be possible. However, yên ổn not quite sure how to call the class. There is a java example using the API which is run in command line. To run or compile this example, i have to hotline : java -classpath .:../ ...........how can avoid this problem?
another question : The class which i want to điện thoại tư vấn is in jar file. It"s in directory, say : aaa/bbb/ccc/ddd/eee......how to lớn instantiate a class which is in a sub directories?
is it possible for me khổng lồ just instantiate the API class (API available from the database server) và call the methods on it?
Cheers.....
Try this liên kết http://www.projectzero.org/zero/silverstone/latest/docs/zero.devguide.doc/zero.php/ZeroAdvancedPHPJavaBridge.html
Thank you very much for the replies.....I already setting up the apache using php_java bridge và it works well (the PHP can access all java class, such as java.lang etc).....
Xem thêm: Ung Thư Không Có Thuốc Chữa, Những Bước Tiến Trong Điều Trị Ung Thư
yes, write java application và php connect khổng lồ the java application could be possible. However, lặng not quite sure how to gọi the class. There is a java example using the API which is run in command line. Lớn run or compile this example, i have to hotline : java -classpath .:../ ...........how can avoid this problem?
another question : The class which i want to hotline is in jar file. It"s in directory, say : aaa/bbb/ccc/ddd/eee......how khổng lồ instantiate a class which is in a sub directories?
is it possible for me khổng lồ just instantiate the API class (API available from the database server) và call the methods on it?
Cheers.....
I am guessing that "aaa/bbb/ccc/ddd/eee" is a package name. So, use aaa.bbb.ccc.ddd.eee.YourClassName. Make sure that the path of .jar must added with CLASSPATH env; variable.
Thank you very much for the replies.....I already setting up the apache using php_java bridge và it works well (the PHP can access all java class, such as java.lang etc).....
yes, write java application và php connect lớn the java application could be possible. However, yên not quite sure how to điện thoại tư vấn the class. There is a java example using the API which is run in command line. Lớn run or compile this example, i have to hotline : java -classpath .:../ ...........how can avoid this problem?
another question : The class which i want to hotline is in jar file. It"s in directory, say : aaa/bbb/ccc/ddd/eee......how khổng lồ instantiate a class which is in a sub directories?
is it possible for me lớn just instantiate the API class (API available from the database server) và call the methods on it?
Cheers.....
Since you said you are calling java from php ... Using java-php bridge... Can u please list me down the steps ... As i am unable to bởi vì the same ... Thanks in advance!!
We"re a friendly, industry-focused community of developers, IT pros, digital marketers,and giải pháp công nghệ enthusiasts meeting, learning, & sharing knowledge.
Reach out lớn all the awesome people in our software development community by starting your own topic.We equally welcome both specific questions as well as open-ended discussions.
Start New TopicYou"re trying to visit a URL that doesn"t currently exist on the web.Most likely, a thành viên posted a links a long time ago khổng lồ a website page that has since been removed.It"s also possible that there was a typo when posting the URL.We redirect you to this notice instead of stripping out the liên kết to preserve the integrity of the post.