Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Is this database dump design ok?

  • 23-01-2013 09:24AM
    #1
    Closed Accounts Posts: 6,075 ✭✭✭


    I have written a Java program to do the following and would like opinions on my design:

    Read data from a CSV file. The file is a database dump with 6 columns.
    Write data into a MySQL database table.
    The database table is as follows:
    CREATE TABLE MYTABLE ( 
    ID int PRIMARY KEY not null auto_increment, 
    ARTICLEID int, 
    ATTRIBUTE varchar(20), 
    VALUE text, 
    LANGUAGE smallint, 
    TYPE smallint 
    );
    

    I created an object to store each row.
    I used OpenCSV to read each row into a list of objects created in 1.
    Iterate this list of objects and using PreparedStatements, I write each row to the database.
    The solution should be highly amenable to the changes in requirements and demonstrate good approach, robustness and code quality.

    Does that design look ok?

    Another method I tried was to use the 'LOAD DATA LOCAL INFILE' sql statement. Would that be a better choice?


Advertisement