The following code will read Excel sheet and print it to console, i want to read excel values and store in to Database.
Can you give me logic to read cells and store in to DB
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
From Excel sheet i read all the fields as string . In that date field is there , i am getting "dd/mm/yyyy" format.
But i want to convert this to "yyyy/mm/dd". i have tried with SimpleDateFormat class. But i could not get.
can you help me
with the following code i can read multiple excel files in a single workbook and store in to database. Now
i want to read multiple workbooks and store in to db. can you give me any logic for this.
Now i want to read multiple workbooks and store in to db. can you give me any logic for this.
There is a method that reads one file and stores something to the database - it sounds as if calling that method multiple times with different files would do the trick. Have you tried that? If so, what was the result? If not, tell us where you are stuck making progress.
Well, the "first" method reads one file and stores it to the DB, no? What is the problem with calling xlreader.first(..) repeatedly with different filenames?
I don't follow - what difference does it make whether the user selects the file, or if the filename is hardcoded? The Excel/DB part would be the same, no?
If you're asking something else, TellTheDetails. Your last two posts were very short, so it's hard to know what you have, and what problems you're encountering.
consider i have a folder prakash,inside that i would like to find all excel files . Once i found all excel files i have read the same and store in to db
OK, that's not hard. What do you have so far, and where are you stuck making progress? Are you familiar with the java.io package, particularly the File class and its methods? If not, that's where you should start.
with the following code i can read multiple excel files. but now i want to read multiple excel files from single folder in
a single line. i dont want to call "first" method again and again. which means i want call excel file dynamically
but now i want to read multiple excel files from single folder in a single line. i dont want to call "first" method again and again. which means i want call excel file dynamically.
Create a method that takes the name of the directory as parameter, and in that method iterate through all files in that directory. For each xls file you'd then call the first method.
The java.io.File class has methods for enumerating all files in a directory. You can then check their names in a loop, and only process those with appropriate file names (like with an "xls" extension).