This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes saving to a database. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "saving to a database. " Watch "saving to a database. " New topic

saving to a database.

Naf Rash
Ranch Hand

Joined: Feb 19, 2004
Posts: 85
Just a quick question. I have some data in the form {some numbers separated by commas} which are saved to a text file. I can do this and it is working but what I wanted to know is whether it is possible to save the {numbers} into a database so that each field contains a {...}. If so how can I do this and do you have any egs. Any help will be greatly appreciated. Thanks.
Loren Rosen
Ranch Hand

Joined: Feb 12, 2003
Posts: 156
You can certainly save this data as strings in a database. On the database side they would be CHARs or VARCHARs. This would gain you the ability to do atomic updates, and possibly make it easier to retrieve a particular string.
But usually with databases it's better not to store strings with internal structure which the application will decode. It's better instead to get the database structure to reflect the actual structure of your data. So what are you trying to accomplish with your data?
Naf Rash
Ranch Hand

Joined: Feb 19, 2004
Posts: 85
I just want it to display/store the sets of numbers that I produce.
I agree. Here's the link:
subject: saving to a database.
It's not a secret anymore!