Solved

Import CSV Files

Posted on 2007-04-08
2
255 Views
Last Modified: 2010-03-31
Hi,

I would like to create one more enhancement in my SWING application to import the CSV files and insert them into DB. Well, that sounds easy. However, the CSV files may vary in the columns order and etc so I need to provide the users a way to dynamically mapping to the column in DB.

Right now, I am thinking to create a dynamic query to do this (I think that it should do it). However, does anyone of you have any other idea or better idea?

Thanks
David
0
Comment
Question by:suprapto45
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Accepted Solution

by:
n_sachin1 earned 250 total points
ID: 18875357
Hi David,
  You can probably look towards creating a table/column name to CVS column header name mapping. Use this information to map the CVS file data to your prepared statements/result sets for insert/update/retrieve functions.
You can do this as a pre-processing action before you pass the information to the queries.
regards
Sachin
0
 
LVL 16

Author Comment

by:suprapto45
ID: 18880141
Thanks.

Sorry for the delay. I will have a look at your comment later on.

David
0

Featured Post

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question