• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to read file as a different user from java application

 
varun srivastv
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am running a java web application as unix user USER1. The application connects to a database whose DB username and password is stored in a file(say xyz) which is readable only for unix user USER2 and not USER1. How can I read the username and password from the file whic is accessible only to USER2 while running my application as USER1.

Thanks,
Varun
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!