调试 PL/SQL 代码
我有一个非常有趣的情况。我被分配将一个完整的数据库驱动应用程序迁移到 Java/Spring 和 Tomcat 服务器,现在我的挑战是当前应用程序没有任何 java,只有过程、包和函数,一切都是 PLSQL code>,即使前端是在包中,htp.p
标签也有所有HTML
前端代码。
另一个具有挑战性的部分是应用程序是遗留应用程序,许多开发人员都在开发它,最后一个刚刚离开。
我想知道您会给与我有类似情况的人提供什么方法和指导,以及调试 PLSQL
应用程序的方法是什么,如果您能提供一些关于调试的有用指示,那么真的会吗? >PLSQL 以及一些书籍或网站的参考。
谢谢。
I have very interesting situation. I have been assigned to migrate an complete database driven application to Java/Spring and Tomcat Server, now my challenge here is that current application does not have any java, there are only procedures and packages and functions and everything is PLSQL
, even front end is in packages, htp.p
tag has all HTML
front end code.
Other challenging part is that application is legacy application and many developers have worked on it and the last one has just left.
I want to know what approach and guidance you would give to someone who has similar situation as mine and also what are the ways to debug the PLSQL
application, would really if you can some useful pointers about debugging PLSQL
along with some reference to books or web sites.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最好的办法是使用数据库设计(假设它们没问题)和视图设计的当前版本的 HTML 输出,并在您满意的任何 Java 框架中重做应用程序。如果您只是尝试用 Java 重新实现该应用程序,那么该应用程序的 PL/SQL 版本将非常不适合。
htp 和 htf 包是 PL/SQL Web Toolkit< /a>.从这些过程到 HTML 标记几乎是一对一的映射,因此它们的级别非常低并且不难理解。它基本上相当于 PL/SQL 的 servlet,只是功能较弱。
调试 Web 工具包代码非常困难,因为您必须远程连接到 Apache modplsql 模块正在使用的数据库会话。 Oracle 的 JDeveloper 曾经支持此功能,但当前版本似乎无法正常工作,至少在我最近的尝试中与 Oracle 11g 无法正常工作。使用老式的打印或日志记录方法进行调试要容易得多,例如使用 LOG4PL/SQL。但实际上你不想深入研究代码,因为无论如何你都应该把它们全部扔掉。
The best thing to do would be use the database designs (assuming they're OK), and the HTML output of the current version for your view designs, and redo the application in whatever Java framework you're happy with. The PL/SQL version of the application would be a very poor fit if you just tried to re-implement it in Java.
The htp and htf packages are the PL/SQL Web Toolkit. There's pretty much a one-to-one mapping from these procedures to HTML tags so they're very low level and not hard to understand. It's basically the equivalent of servlets for PL/SQL, only less powerful.
Debugging web toolkit code is very awkward because you have to remotely attach to the database session that the Apache modplsql module is using. Oracle's JDeveloper used to support this but current versions don't seem to work properly, at least not with Oracle 11g in my recent attempt. It's a lot easier to use old-fasioned print or logging methods of debugging, for example using LOG4PL/SQL. But really you don't want to get into the code that deeply since you should be throwing all of it away anyway.
试试这个教程: 使用 Oracle SQL Developer 开发和调试 PL/SQL (2.1)
Try this tutorial: Developing and Debugging PL/SQL using Oracle SQL Developer (2.1)