I have two applications (AppA and AppB). AppA is coded in Java
with unidata database
and AppB is coded in PHP
with MySQL database
. I want AppB to display the information AppA has. I wonder if there is any way to bridge the communication of the database between AppA and AppB?
Asked
Active
Viewed 363 times
2
1 Answers
0
You could also UniObjects for Java in your PHP application uses PHP's Java functions.
A second option (probably your best) is to look into U2 RESTful Web services. You can find it in the free U2 DBTools package and it will allow you to expose UniData as as a RESTful Web service. That should be easy enough to consume in PHP.

Dan McGrath
- 41,220
- 11
- 99
- 130
-
Hi Dan, thanks for the solutions. I am looking into UniObjects as I may not want to touch on the server that AppA is hosted on. Do I need to install anything library to get UniObjects for Java running? FYI, I am running on linux server for AppB. – Jia-Luo Jun 24 '13 at 23:28
-
You only need to get the UOJ library (asjava.zip) from the U2 Clients package. As for U2 RESTful, it doesn't require you touching AppA, it's a middle tier that can run on any server; it uses UniObjects for Java internally as it's method of connection. – Dan McGrath Jun 24 '13 at 23:47
-
I downloaded asjava.zip from other sources. I stored it in the root folder of my code. I run my php with the following code: $UdSession = new COM("UniObjects.unioaifctrl"); $UdSession->HostName = $Hostname; $UdSession->AccountPath = $Accountpath; $UdSession->UserName = $Username; $UdSession->Password = $Password; $UdSession->Connect(); I encountered "Failed to create COM object `UniObjects.unioaifctrl':" error. Any idea why? – Jia-Luo Jun 25 '13 at 16:38
-
Your code there is for the old deprecated UniObjects (COM) driver. COM is not Java. Try reading through this, especially the TestMe.php link: http://www.pickwiki.com/cgi-bin/wiki.pl?PhpJavaIntegration – Dan McGrath Jun 25 '13 at 19:21
-
Thanks Dan. Really appreciate your help. I will take a look at the link. Right now, I am testing the connection using Java and here is the TestMe.java: http://www.pickwiki.com/cgi-bin/wiki.pl?UniObjectsTest. I encountered "No RPC connection active". What do I have to do about this? What is the "Accountpath" in the UniSession object referring to? Also, I have the UniDK installed from U2 Clients package in windows. Can I extract the asjava.zip library from UniDK and work on my code in Mac OS? – Jia-Luo Jun 25 '13 at 20:47
-
That is the account of that your U2 application is in. If you check AppA, you should see what account it is connecting to, just use that. Generally it is the absolute path on the server to where all your data lives. Yes, you should be able to use that asjava.zip file on your Mac. – Dan McGrath Jun 26 '13 at 05:07