简体   繁体   English

在PHP上模拟Java应用程序

[英]Emulation of Java application on PHP

Scenario: 场景:

We have a PHP/MySQL based corporate web portal and a separate MS SQL database on a remote server which could be accesed by a 3rd party vendor Java application(web client communicating with the MSSQL database). 我们在远程服务器上有一个基于PHP / MySQL的公司Web门户和一个单独的MS SQL数据库,第三方供应商Java应用程序(与MSSQL数据库进行通信的Web客户端)可以访问该数据库。

Requirement: 需求:

I would like to get rid of that Java application and transfer all functionalities to the PHP web portal and I need to figure out the queries as I don't have the source code of that Java application and there is no way to reach the vendor to ask. 我想摆脱该Java应用程序并将所有功能转移到PHP Web门户,并且我需要弄清楚查询,因为我没有该Java应用程序的源代码,也无法联系供应商。问。

Is there any way I can capture the queries that Java application is sending so I can use those in my PHP scripts? 有什么方法可以捕获Java应用程序正在发送的查询,以便可以在PHP脚本中使用这些查询?

Maybe tracing last queries from MSSQL somehow? 也许以某种方式跟踪来自MSSQL的最后一个查询? Or 要么

Somehow see what the Java application emits to the database in some way? 以某种方式查看Java应用程序以何种方式向数据库发出什么?

While you can log incoming queries coming into the server ( How to see query history in SQL Server Management Studio ) you are still going to rewrite most of the queries as I'm sure most of them will be dynamic. 尽管您可以记录进入服务器的传入查询( 如何在SQL Server Management Studio中查看查询历史记录 ),但由于我确信大多数查询将是动态的,因此您仍将重写大多数查询。 You will simply see the end result in the log like this: 您将在日志中简单地看到最终结果,如下所示:

select * from users where id=5

While in the php code it will be a mysqli or pdo function that binds the 5 value to a prepared statement. 在php代码中,它将是一个mysqli或pdo函数,它将5值绑定到准备好的语句。 So you will have to figure out why or how the java application came up with the query it did. 因此,您将必须弄清楚java应用程序为何或如何提出查询。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM