my dog learned polymorphism*
The moose likes JDBC 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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
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.
Similar Threads
Formatted JTextField
Issue adding double value
Unique primary key generator
2 JBoss servers pointing to 1 database
Web Scraping from an applet