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

initialize database from properties file

 
James Hewitt
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having problems writing a servlet to populate a database with values taken from a properties file (a simple text file). I have no problems when the properties file looks like this:
x=1
y=2
I can simple use String x = properties.getString("x"); and then enter x into an sql query. However, I need to populate the database from a property file which looks like this:
1 5
2 4
3 3
4 2
5 1
That is, the left column represents a series of values of "x" and the right column a series of values of "y". How do I get these values into my servlet and enter them en masse into a database?
Thanks in advance,
James
 
rani bedi
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Explore the java.io package. http://java.sun.com/j2se/1.3/docs/api/index.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic