• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Load .mdb file from EJB

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello !

I have a *.mdb file deployed within my ear. Which is located on Glassfish server like this:

MyApplication
- myDBFile.mdb
- myApplication-ejb_jar
- myApplicationWeb_war
- META-INF

The problem is that from EJBs perspective you can only use ClassLoader.getSystemResource(path) or equivalents of ClassLoader.methods.

However this leads me to deploy the .mdb database within a Jar. in my EJB project.

I would like to have it stored in EarContent of my project and access it from there. Is there any possibility to access files that are deployed along the ear from ejb context ?

I tried to get the context path of the ejb session , by using
but this doesn't really help much, as it only points to a path on the server and not on my project.

Can someone help me out, or point out whats wrong with the idea ?

Best regards,

LHD

PS: I know that it is against the restrictions of EJB, to access files in the filesystem. But it's more convenient to have the mdb file deployed within the ear for me.
 
reply
    Bookmark Topic Watch Topic
  • New Topic