Forums Register Login

Copy excel file to access table

+Pie Number of slices to send: Send
How can i copy a excel sheet data to a access table from java code?
+Pie Number of slices to send: Send
+Pie Number of slices to send: Send
POI only helps with reading an Excel file; you'll also need to set up an ODBC datasource for Access. Then you can use the JDBC API to write to the DB.
+Pie Number of slices to send: Send
Actually I am developing a java application in which I want to develop an import utility that will use JFileChooser, so how can I import Excel file appended to Access database.
+Pie Number of slices to send: Send
POI and JDBC, respectively, solve those two problems. Have you read the web sites we pointed you to yet? Do you understand how they work? If not, what specifically are you unclear about?

(I don't understand what JFileChooser has to do with reading an Excel file, or with writing to a DB, so I can't speak to that.)
+Pie Number of slices to send: Send
yes i have read the mentioned sites.
i am using jexcelapi for handling excel instead of POI.
and to connect with access i am using JDBC.

But the issue is that the database is in access and i want to develop a utility in my tool,
such that when ever one wants to add/update many records at a time, the user would not add each record by the GUI individually,
instead just import the excel and records get copied into access.

so i am thinking of using a JFileChooser to browse the excel file and then on click of a button to do the import thats copying of data to access.
so if any one has any idea about how to do so.
thanks...
+Pie Number of slices to send: Send
i can use JXL to copy data from one excel to another but can i copy excel to access?
+Pie Number of slices to send: Send
If you can read data from an Excel sheet, then you can use JDBC to insert it into a DB, no?
+Pie Number of slices to send: Send
i am able to read data in form of object of jexcelapi i.e sheet
eg:import java.io.File;
import java.util.Date;
import jxl.*;

...

Workbook workbook = Workbook.getWorkbook(new File("myfile.xls"));
Sheet sheet = workbook.getSheet(0);



so how do i pass this sheet into an access db existing table that is how to build the JDBC SQL query which picks data from excel to access
+Pie Number of slices to send: Send
You can't. You need to iterate over the cell contents of the sheet, and then issue INSERT statements to the DB as appropriate.
get schwifty. tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2619 times.
Similar Threads
Access database issue.
populate data from csv into oracle
resize tables by the user is this possible ???
Peculiar problem facing in web application due to microsoft excel
How to generate real excel reports
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 09:57:28.