my dog learned polymorphism*
The moose likes EJB and other Java EE Technologies and the fly likes problem with loading an excel file data to  database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "problem with loading an excel file data to  database" Watch "problem with loading an excel file data to  database" New topic
Author

problem with loading an excel file data to database

raghu tammina
Ranch Hand

Joined: Jul 11, 2012
Posts: 59
Hi,

I'm loading an excel file into database(used poi-3.9 jar).it has Text(tab delimited) format. while loading it is showing an exception in console i.e,

" Invalid header signature; read 0x096F6E5F74726170, expected 0xE11AB1A1E011CFD0" what it means?how to solve this format issue?

if i'm trying to save that file after some changes to be done then it is displaying an alert pop up.please find the attachment.


[Thumbnail for Untitled.png]

Sresh Rangi
Ranch Hand

Joined: Nov 28, 2012
Posts: 45
    
    1
Excel files begin with 0xE11AB1A1E011CFD0 but the file you're using is a tab separated file which POI can't read. You need to either use a different library like opencsv, or save in the excel format (xls/xlsx).
Amir Keibi
Ranch Hand

Joined: Apr 23, 2012
Posts: 49

Although this is a Java forum, I'm not going to assume that you aren't open to other options. Especially because there isn't anything in your question about using only Java.

When it comes to Microsoft Office, I'd recommend using Microsoft technology. VSTO provides native support for reading Excel documents. You could use VSTO with C# to read the Excel file and Oracle native driver for .NET (ODP.NET) to update the database.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41108
    
  45
Amir Keibi wrote:Although this is a Java forum, I'm not going to assume that you aren't open to other options. Especially because there isn't anything in your question about using only Java.

A questionable non-assumption, given that this is the JavaEE forum, so we're presumably talking about a server-side issue. Assuming that I might be open (or even be able) to using Microsoft technology on a server that is otherwise used to run JEE (and thus is likely Linux) is quite a leap.
Amir Keibi
Ranch Hand

Joined: Apr 23, 2012
Posts: 49

If you say so. For the record: http://www.mono-project.com/Main_Page
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41108
    
  45
I do say so. And if you're seriously suggesting Mono I'll point out that in my experience that is even less likely to be used on a production system than Windows.
Amir Keibi
Ranch Hand

Joined: Apr 23, 2012
Posts: 49

How many questions are posted throughout this website just because remotely are related to Java?
As for Mono not being used in production, that's just not a valid statement:

http://www.mono-project.com/Companies_Using_Mono

I'm not an advocate of any technology. I just think that a right tool should be used for the job.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41108
    
  45
Nobody said it wasn't used in production.
Amir Keibi
Ranch Hand

Joined: Apr 23, 2012
Posts: 49

I'm sorry. That's how it sounded to me.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with loading an excel file data to database
 
Similar Threads
loading data from excel to oracle/informix
set request in init() method
Automation
How to handle RecordInputStreamLeftoverDataException Exception
File upload using Java vs, SQL loader