Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Virtual Machine / July 2004

Tip: Looking for answers? Try searching our database.

passing results from JAVA to procedures in other languages

Thread view: 
Jeremy Watts - 21 Jul 2004 10:57 GMT
hi,

how easy is it to pass results from applets written in JAVA to procedures
written in other languages, more specifically PHP?

i am principally writing something in PHP, but am considering using JAVA for
a specific task, in order to take advantage of its BigDecimal and BigIntger
facilities, and then pass a result from the JAVA routine to a PHP one.

thanks
Roedy Green - 21 Jul 2004 18:00 GMT
>how easy is it to pass results from applets written in JAVA to procedures
>written in other languages, more specifically PHP?

JNI lets you pass to C/C++.  From there you are on your own.

Signature

Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.

Tony Morris - 24 Jul 2004 02:02 GMT
> JNI lets you pass to C/C++.  From there you are on your own.

JNI doesn't "pass to C/C++".
It passes to "native" code.
How that code was compiled is irrelevant.
The fact that the primary use of JNI is to call out to native code that has
been compiled using C/C++ is also irrelevant.

Signature

Tony Morris
http://xdweb.net/~dibblego/

Roedy Green - 24 Jul 2004 03:01 GMT
>JNI doesn't "pass to C/C++".
>It passes to "native" code.
>How that code was compiled is irrelevant.
>The fact that the primary use of JNI is to call out to native code that has
>been compiled using C/C++ is also irrelevant.

That is not quite true. JNI passes using C/C++ calling conventions. If
the language you are passing to does not use C/C++ conventions, you
need a bit a C/C++ glue or need to warn the language to generate C
style calls, e.g. Pascal which pushes parms in the opposite order to
C.

Signature

Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.

Roedy Green - 24 Jul 2004 06:07 GMT
>That is not quite true. JNI passes using C/C++ calling conventions. If
>the language you are passing to does not use C/C++ conventions, you
>need a bit a C/C++ glue or need to warn the language to generate C
>style calls, e.g. Pascal which pushes parms in the opposite order to
>C.

the other thing to consider is the headers for the JNI library are
provided only in C/C++ form.  If you wanted to access them from
Pascal, for example, you would have to write your own equivalent of
Javah.

Signature

Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.