Meaningless Drivel is fun!
The moose likes JDBC and Relational Databases and the fly likes initialize database from properties file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "initialize database from properties file" Watch "initialize database from properties file" New topic

initialize database from properties file

James Hewitt

Joined: Jul 09, 2001
Posts: 27
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:
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,
rani bedi
Ranch Hand

Joined: Feb 06, 2001
Posts: 358
Explore the package.

Cheers,<br />Rani<br />SCJP, SCWCD, SCBCD
I agree. Here's the link:
subject: initialize database from properties file
It's not a secret anymore!