• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Parsing Excel-2007-Format (xlsx)

 
Ranch Hand
Posts: 60
Hibernate Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I want to read data from Excel-2007-Format (xlsx) and store it in Data base, i try to use JXL but it not support this Excel-2007 and i also try to read it through Apachi POI API but i not find any proper solutions.


please any body have any idea about this help me








 
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What did you go through in Apache POI?

You can read a .xlsx file with POI 3.5+ using a WorkbookFactory.

http://poi.apache.org/spreadsheet/quick-guide.html#ReadWriteWorkbook
 
Mark Kafe
Ranch Hand
Posts: 60
Hibernate Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
which jar i used for this? currently i used POI = poi-ooxml-3.5-beta5.jar and poi-scratchpad-3.2-FINAL file
 
Mark Kafe
Ranch Hand
Posts: 60
Hibernate Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i try to this code but it gives errors





java.lang.NoClassDefFoundError: org/apache/poi/ss/usermodel/Workbook
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
Exception in thread "main"
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

which jar i used for this? currently i used POI = poi-ooxml-3.5-beta5.jar and poi-scratchpad-3.2-FINAL file


Don't use any of the 3.2 files; use the 3.5 files.
 
Mark Kafe
Ranch Hand
Posts: 60
Hibernate Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thnx Ulf Dittmer,
i change the All jars to 3.5beta5 but same error again.............
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe there's a typo somewhere? I found that class in a file called poi-3.5-beta6-20090622.jar (but I *think* it was there even in 3.5 beta 5).

Which command, exactly, are you using to execute the code?
 
Mark Kafe
Ranch Hand
Posts: 60
Hibernate Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i run it from myEclipse through main method
 
Mark Kafe
Ranch Hand
Posts: 60
Hibernate Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can you tell me please which jars working fine for this purpose because i try all 3.5 beta5 but i could not got my result,
i m very thank to you if i do this with yous helps
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I could download 3.5 beta 5 to see if the class is in there, but since it's your problem I'll let you download 3.5 beta 6 instead; that has the class for sure. If you then still experience the problem it's an issue of setting the classpath incorrectly.
 
Mark Kafe
Ranch Hand
Posts: 60
Hibernate Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ulf Dittmer,

i use these files poi-ooxml-3.5-beta6-20090522,poi-scratchpad-3.5-beta6-20090222,poi-contrib-3.5-beta6-20090222

in this package org.apache.poi.ss.usermodel only one class show WorkbookFactory; Workbook class not in this package

but still problem error is

java.lang.NoClassDefFoundError: org/apache/poi/ss/usermodel/Workbook
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
Exception in thread "main"
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're missing the file I mentioned above, which is called poi-3.5-beta6-20090622.jar. (You most likely don't need the contrib file, but it doesn't hurt to have it in the classpath.)
 
Mark Kafe
Ranch Hand
Posts: 60
Hibernate Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thnx Ulf Dittmer
now its working when i add this file
 
On top of spaghetti all covered in cheese, there was this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic