File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Importing data from a file to a MS-Access database table in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Importing data from a file to a MS-Access database table in java" Watch "Importing data from a file to a MS-Access database table in java" New topic
Author

Importing data from a file to a MS-Access database table in java

Saumyaraj Zala
Ranch Hand

Joined: Aug 06, 2012
Posts: 56

I have a file which consists of data like:-

Question 1: Pick the odd one.
option 1:cat
opion 2:peacock
option 3:kite
option 4:eagle
answer:cat

Now i want to store this in an Ms-Access database table which has following columns:-

question option1 option2 option3 option4 answer

Which input file will be easier to import data to table in this format?
I want to do this programmatically and i am using jsp/servlets for this web application. Which method or library to use?
Thankyou.


Why do we fall? So that we can learn to pick ourselves up.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10535
    
    9

Your question is unclear. What are you having problems with?
Uploading the file?
Parsing the file to identify the actual data?
Connecting to the DB?
Inserting the parsed data into the DB?
Anything else?


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Saumyaraj Zala
Ranch Hand

Joined: Aug 06, 2012
Posts: 56

I want to know which type of file(csv,txt e.tc) will be best or easy to import in the following format and how to parse it.
I had no problems with connection to database.
Thankyou.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10535
    
    9

I think the easiest would be to go for a csv format and use something like http://opencsv.sourceforge.net/
Saumyaraj Zala
Ranch Hand

Joined: Aug 06, 2012
Posts: 56

Thankyou.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Importing data from a file to a MS-Access database table in java