Win a copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java this week in the Agile and Other Processes forum!
  • 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
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Please find out why the Error is in my code!!!!

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am developing a code which produces a graph using CEWOLF jar files and charts, i am using Excel as the Datasource. but am still getting this error of illegal start of expression and ";" expected for the try catch block.

Please help!!!

i give the code bellow


[ June 05, 2008: Message edited by: Scott Selikoff ]
 
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

Next time you post code of any length, please UseCodeTags. The code is unnecessarily hard to read as it is.

It is probably much easier to track down the problem if you write a standalone application that reads the Excel file. Then once that works, you can embed the code in the web app.
 
author & internet detective
Posts: 39880
798
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sourav,
Welcome to JavaRanch!

That code wouldn't compile. It is not legal Java to have a loose try/catch block. It needs to be in a method (or static block.) Since it is accessing a database, maybe you want to make the the main method.
 
Let me tell you a story about a man named Jed. He made this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!