IntelliJ Java IDE
The moose likes JDBC and the fly likes Oracle identify sql statement from servlet or jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JDBC
Reply Bookmark "Oracle identify sql statement from servlet or jsp" Watch "Oracle identify sql statement from servlet or jsp" New topic
Author

Oracle identify sql statement from servlet or jsp

Ionut Putinei
Greenhorn

Joined: Oct 11, 2009
Posts: 3
HI,

Can e servlet or jsp that does someting in database(dml) be written in such a manner that i can identify from database the source of the sql?

thanks


David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12612
SQL is SQL. If you want something different to happen depending on where something is being executed from you'd have to write it that way.
David Rolfe
Greenhorn

Joined: Oct 08, 2003
Posts: 11
There's nothing to stop you from putting whatever you like into a comment as part of the SQL staements being issued:

SELECT /* This is freds SQL */ * FROM emp;

If you can get access to the SQL statements the database knows about you can find *your* sql fairly easy.

If your database is Oracle you should google the following:

Oracle v$session
dbms_application_info.set_module
oracle userenv


David Rolfe
Orinda Software, Dublin Ireland.

Makers of OrindaBuild, a Java Web Service Generator for Oracle.
 
 
subject: Oracle identify sql statement from servlet or jsp
 
Threads others viewed
OLAP - how to ?
Error java.sql.SQLException: ORA-00923
calling bean in servlet
Marcus Green: incorrect answer?
None of my servlets are available
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com