how to import data from excel to sqlserver using java
Hi all
I need to import the data from excel sheet into sql server
by using java...how can i do it.? can u please tell me the solution..
i need it urgent...
Thank u all in advance
regards
rajesh
Hi all
I need to import the data from excel sheet into sql server
by using java...how can i do it.? can u please tell me the solution..
i need it urgent...
Thank u all in advance
regards
rajesh
You could use the JExcel API ( http://jexcelapi.sourceforge.net/). The import part depends a little bit on which sql server you use. Using PostgreSQL for example allows you to import files in CSV format, which possibly would reduce your programming task considerably.
thanks for ur reply..i m using POI for read the excel file..
i want to connect to the excel file thru sql server in java
thanks for ur reply..i m using POI for read the excel file..
i want to connect to the excel file thru sql server in java
can any one give suggestion
I'm not an expert in MS office apps, but if it is possible you should use an ODBC driver to access office data sources. I nevertheless think that avoiding this would be much easier, because, honestly, Excel is no substitute for a decent rdbms.
There are a number of routes you can take.
You can export the data as CVS format (comma separated values) which is fairly easy for you java program to read,
You can use POI (available at Sourceforge) which provides an API to read xls files.
You can get a Java to COM+ package from the same place, and take the data from a running instance of Excel.
You can use the JDBC/ODBC bridge to read the spreadsheet as if it were a database.
In any case use JDCB to insert records into the MSSQL database.