• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

how to attach excel upload into mysql using jsp

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

This Manager.jsp Page





This upload.jsp page




code was not working fine

 
Saloon Keeper
Posts: 5573
144
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

code was not working fine


That is an unhelpful problem description. What, specifically, is or is not working? File upload? File saving? File retrieval? File display? What, exactly, do you do, and, exactly, was the result? If there were error messages (Java or JavaScript) or exceptions of any kind, post the details.
 
Rancher
Posts: 4116
47
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All that code should be in a servlet, not a JSP page.
At least then you could debug it properly.
 
Bartender
Posts: 20838
125
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm going to have to wash my eyes out with bleach.

Also, DriverManager.getConnection has no place in an Enterprise Java webapp. Use a Connection Pool.
 
Marshal
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Quite apart from the ten programming sins you have in that code, the Java error is like this:

You have a while-loop which iterates through the rows of the spreadsheet. In that loop you have a local variable named rowarrylist, which you use to collect stuff from the spreadsheet.

But it's a local variable so it's unavailable after the loop finishes. Your solution was to create another variable of the same name and assign it a null value. That doesn't work, it will give you a NullPointerException.

Solution: Declare the variable outside the loop so it would be available to other code which needs it.

But like the others said, don't do that in a JSP.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!