Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8170547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:09:34+00:00 2026-06-06T21:09:34+00:00

I have an xls spreadsheet that I’m querying using metaModel, and I want to

  • 0

I have an xls spreadsheet that I’m querying using metaModel, and I want to keep the xls file in the jar, because it won’t be updated. The method used for creating the data context doesn’t allow inputstreams, I tried using this code:

DataContext dataContext = DataContextFactory.createExcelDataContext(getClass().getResourceAsStream("database.xls"));

Unfortunately this doesn’t work, as the method createExcelDataContext doesn’t take inputstreams as a parameter. Is there any way to keep the file in the jar?

It seems the easiest way to do this is just export to csv, as this is easily done.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T21:09:36+00:00Added an answer on June 6, 2026 at 9:09 pm

    Given that other kinds of contexts can be created from an InputStream, I would guess that it’s a limitation of Excel, and that you won’t be able to open the Excel file if it isn’t on the file system.

    Consider extracting the file from the jar and copy its content to a temporary file, possibly deleted when the application ends. See File.createTempFile() and File.deleteOnExit().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using this Spreadsheet gem to export xls file. I have the following
I have a 3rd Party tool that generates an xml spreadsheet (*.xls). I have
I have a generated xls file on my server that I would like to
I have a reliable and tested import method between an .xls spreadsheet[1] that returns
I have a django view that I want to return an Excel file. The
I have an Excel 97-2003 .xls spreadsheet converted from .dbf using C#-4.0 and Excel.Interop.
I have written a PHP class that gets the headers from a .xls spreadsheet
I have an Excel Spreadsheet (.xls) which i want the users to be able
I am trying to query an .xls spreadsheet with VBScript, but I have run
I have created password protected zip file which has xls file with the help

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.