Skip to main content

Connection with an excel document

1 reply [Last post]
Joined: 2007-04-16

Hi, I have a program that use a excel document as database, I get the data with the library JExcelAPI.

The application works fine, giving in the code the path of the document ("c:\book.xls"). When i use JWS i use the path "..//book.xls", but the program cant read from the excel, thats is located in the same directory of the proyect.

If the excel document is suppose to be in the server with the .jnlp file and the .jar of the program, What path i have to use?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2006-11-09

You should probably be using an InputStream to the excel file as the argument for JExcel's API. So if the file is on the server, it has a URL and you'd pass an InputStream representing this URL to JExcel. If the excel file is [b]inside [/b] the jar file, then you can get an InputStream using something like

InputStream is = instance.getClass().getResourceAsStream(name)

where name is the package relative name of the file.