This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Datasource Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Datasource" Watch "Datasource" New topic


Hanna Bech

Joined: Sep 10, 2008
Posts: 5
Is is possible to use a datasource (in JSP) for something besides the database connection? I want to specify an upload directory for my images but I don't want to have to change it in the code itself later. So can I somehow do it in the context file using a DataSource?
Thanks in Advance
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

If this is for a JSP application, whats wrong with using the application context?

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Hanna Bech

Joined: Sep 10, 2008
Posts: 5
Thanks, that's probably what I wanted in the first place, I just got somewhat confused, as I'm new to this. Anyway, I worked it out using the "getRealPath()" method instead. However, I am getting an AccessControlException: access denied whenever I try to test it out. I'm pretty sure I have the right path now, or at least I'm moderately sure.
Any ideas?
I agree. Here's the link:
subject: Datasource
Similar Threads
How do you connect to database(sql) from an ejb application
how to configure datasource in jboss
How to integrate SQL server with JBOSS
Oracle XA Datasource
Database Connection