• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to protect password in java file

 
hitesh parikh
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
In all jdbc programs we supply the username & password of the database user in the java program itself.
How can i avoid this. Say anybody can decompile the class file & obtain the username & password to the database
What are the other alternatives available
Rgrds
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch, hitesh parikh!
Obviously, the account information could reside in a properties file that is read in.
The class file would then not have explicitly knowledge of the account information and securing the properties file would be a separate issue.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic