How It Works, How To Use Php Api In Java

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


java
01
Share
6 Contributors6 Replies 781 Views5 Years Discussion Span

Recommended Answers


Answered bymmiikkee121in apost from16 Years Ago

No, but you could use JSP...

Jump lớn Post
Answered byjwenting1,823in apost from16 Years Ago

Or 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 Post

All 6 Replies



mmiikkee121Posting Whiz in Training
16 Years Ago

No, but you could use JSP...


00
Share
*
Last Seen 2 Hours Ago
jwenting1,823duckman Team Colleague
16 Years Ago

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.


00
Share

ms880Newbie Poster
16 Years Ago

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.....


00
Share

albertolarrea0Newbie Poster
12 Years Ago

Try this liên kết http://www.projectzero.org/zero/silverstone/latest/docs/zero.devguide.doc/zero.php/ZeroAdvancedPHPJavaBridge.html


00
Share
*
Last Seen 22 Hours Ago
kvprajapati1,826Posting Genius Team Colleague
12 Years Ago

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.


00
Share

mdew_47-2Light Poster
11 Years Ago

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!!


00
Share
FacebookLike
TwitterTweet
Be a part of the obatambeienwasirherbal.com community

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.


Sign Up — It"s Free!
Related Topics
Not what you need?

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 Topic
Topics Feed
Reply lớn this Topic
This topic is old!No one has contributed khổng lồ this discussion in over 11 years.Are you sure you have something valuable to địa chỉ to revive the existing conversation?Consider starting a new topic instead.Otherwise, please be thoughtful, detailed và courteous, và adhere to lớn our posting rules.
Message
H1H2
Post Reply
Broken Link

You"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.


Go Back to lớn the PostContinue Anyways

Share Post


Permanent Link
FacebookLike
TwitterTweet

Insert Code Block


Insert Code Block
SearchSearch
Forum CategoriesLatest ContentSocialCommunity FunctionsDeveloper APIsLegal
© 2022 obatambeienwasirherbal.com® LLC