• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Computer name through JDBC

 
Danish Araquei
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

In our application i want computer name.

We are using the following step

1) Login to Our System(Browser).
2) From session bean we update one table,while updating that table one trigger is fired.
3)In trigger we update another table along with User-Name(Client name/Browser).In trigger we write following syntax to getting User Name

select sys_context('USERENV','TERMINAL') from dual;

but we are getting User name as null .

While debugging through pl/sql dev or executing that query we are getting USERNAME from which we logged to oracle.

Danish
 
Tim LeMaster
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is because the JDBC connection is not setting up this when it is connecting. Besides the client machine/browser is not connecting to the database - the app server is (where SessionBean is running) more over it is probably using a Connection Pool so all users are running under the same username/password to the database.

Most likely you need to capture the username they logged into the application with and send that along with the insert to capture the user actually making the change.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic