Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: JDBC vs Serialization

  1. #1
    Junior Member
    Join Date
    Feb 2011
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default JDBC vs Serialization

    I'm planning on making a desktop application that stores hash values of files as the key, and the value is some metadata.
    Should I use JDBC, or serialize a hashmap/table? I don't know anything about JDBC yet, so I'm not sure how to choose.


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: JDBC vs Serialization

    JDBC is a tool to interact with a relational database...and a relational database is just that - its strength is in storing data across tables which can then be joined and queried in different ways. If all you wish to do is store key/value pairs, I'd say an alternative is to just store it in flat file format (I'm not a huge fan of serialization for saving data in this manner as it locks you into a particular implementation)

  3. #3
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: JDBC vs Serialization

    You could use java.util.prefs.Preferences if the metadata is simple. Have you designed for hash collisions?

Similar Threads

  1. Serialization of lists
    By colerelm in forum What's Wrong With My Code?
    Replies: 1
    Last Post: December 5th, 2011, 10:39 PM
  2. JDBC Problem - com.mysql.jdbc.Driver
    By icu222much in forum Java Servlet
    Replies: 2
    Last Post: November 21st, 2011, 11:54 PM
  3. DefaultTableModel Serialization
    By newbie in forum Java Theory & Questions
    Replies: 8
    Last Post: August 15th, 2011, 07:46 PM
  4. Sub class Serialization
    By Param in forum Java Theory & Questions
    Replies: 6
    Last Post: April 23rd, 2010, 02:04 AM
  5. serialization problem
    By Park in forum Object Oriented Programming
    Replies: 2
    Last Post: November 26th, 2009, 04:44 PM