Atitit another language function calls
table of Contents
Call each other between 1 1. Waht common language java python js sql xml h5 c # php, etc.
2. Why do I need to call each other why 1
3.1. Internal interpreter language parser Mode 2 Mode api
3.3 Remote Interface Mode ws rest ajax like 2
3.4 host interface call mode register 2
4.2. Sql call other languages 3
5. Table 3 Comparative major languages
6. Console some internal specification of console 4
6.1 Standard output stdin, stdout and error output 4
6.2. The principle is to execute the command input characters to the console reads the output 4
7. The blocking api programs and sub-line 4
8. faced with common problems to solve 4
Enhance readability
Improve performance, equivalent to the library to write high-performance language
Learn from each other, enhance flexibility in areas such as capacity
Reduce duplication of code in the project of common
Isolated native microService
Improve service stability
Java calls sql. .
Java calls xml h5, mybatis calls inside the sql xml
/bookmarksHtmlEverythingIndexPrj/src/aaa/invokeLan.java
import java.io.BufferedInputStream;
import java.io.IOException;
import org.apache.commons.io.IOUtils;
public class invokeLan {
public static void main(String[] args) throws IOException {
String command = "python D:\\zzz\\py.py";
String rzt = IOUtils.toString(Runtime.getRuntime().exec(command).getInputStream(),"gbk");
System.out.println(rzt);
}
}
os.popen ()
Mainly used to write udf, sp
Language |
method |
java |
Runtime.getRuntime().exec( |
Python |
Os.popen () |
Php |
exec() |
C# |
Process。StandardInput.WriteLine(command) |
Js (node environment |
child_process。exec()
|
|
|
|
|
Console Console ,
Process。StandardInput.WriteLine(command)
Output code reader
Parameter object serialization
Read a long output
Read asynchronous mode
python cmd command calls - launched into the cannon brother - blog Park .html