Cross-Database Join Query Using JDBC And EsProc
Cross-database join query using JDBC: Connect MySQL_A & B, read employee & family tables, join through EID, get RELATION between ENAME & FNAME.
Problem description & analysis We have two MySQL databases. There is an employee table in MySQL_A, whose data is as follows: There is a family table in MySQL_B, whose data is as follows: We need to use JDBC to do a cross-database join query, which is to get the relationship (RELATION) between each employee (ENAME) and their corresponding family member (FNAME) by joining the two tables through EID. Below is the expected result table: Solution: We write the following script p1.dfx in esProc: Code description: A1 Connect to database MySQL_A. A2 Connect to database MySQL_B. A3 Read employe...