• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

initialize database from properties file

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Explore the java.io package. http://java.sun.com/j2se/1.3/docs/api/index.html
reply
    Bookmark Topic Watch Topic
  • New Topic