This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reading passwords and connections from a flat file

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there!
I am currently trying to figure out how to read connection information (ie username, password, dbname,...) from a plain text file. Does anyone have any leads or helpful tips???
Christine
 
Milind Kulkarni
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is how I would proceed:
1> Create an instance of File object
2> Read the file contents using BufferedReader and FileReader objects.
3> Read the file contents line by line.
4> Use the StringTokenizer object to break the line into various String tokens.
5> Store the tokens ( which may include user ids, passwords, etc.) into different vectors.
Regards,
Milind

[This message has been edited by Milind Kulkarni (edited August 30, 2000).]
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again,
Thank you for your help, I have resolved my problem. I'm glad that there is a spot like this where programmers can help one another. I'll keep an eye on this place and help out when I can.
Thanks again.
Christine
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic