• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Computer name through JDBC

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Right! We're on it! Let's get to work tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic