*
The moose likes JDBC and the fly likes Oracle identify sql statement from servlet or jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
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: 12617

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Oracle identify sql statement from servlet or jsp
 
Similar Threads
OLAP - how to ?
Marcus Green: incorrect answer?
None of my servlets are available
Error java.sql.SQLException: ORA-00923
calling bean in servlet