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

[236 byte] By [vrkrajeshrajua] at [2007-11-27 10:40:07]
# 1

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.

abenstexa at 2007-7-28 19:05:00 > top of Java-index,Java Essentials,Java Programming...
# 2

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

vrkrajeshrajua at 2007-7-28 19:05:00 > top of Java-index,Java Essentials,Java Programming...
# 3

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

vrkrajeshrajua at 2007-7-28 19:05:00 > top of Java-index,Java Essentials,Java Programming...
# 4

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.

abenstexa at 2007-7-28 19:05:00 > top of Java-index,Java Essentials,Java Programming...
# 5

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.

malcolmmca at 2007-7-28 19:05:00 > top of Java-index,Java Essentials,Java Programming...