• 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

reading passwords and connections from a flat file

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Come have lunch with me Arthur. Adventure will follow. This tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic