aspose file tools*
The moose likes Beginning Java and the fly likes Best first steps for runtime datasources Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Best first steps for runtime datasources" Watch "Best first steps for runtime datasources" New topic
Author

Best first steps for runtime datasources

Eric Schumacher
Greenhorn

Joined: Jun 02, 2004
Posts: 20
I need a nudge or a shove in the right direction. I'm a Java newbie, but need some architecture advice on working with multiple db's in a servlet or J2EE situation....so I can narrow my vision/world a little and prevent getting overwhelmed.

My challenge in a Nutshell.

I have a commercial product that uses Oracle. This product has one database for 'Site Administration' and any number of 'project' db's (all with the same 'project' schema). The 'Site Administration' db stores in one of it's tables the location and connection string information required to locate and connect to the 'Project' db's. The number (currently around 80) and location of the 'Project' db's can and does change during the day, week, month etc.

I want to create an application that reports from the 'project' db's. At this point I'm trying to understand the *best* approach for dynamic runtime datasources. As I see this through my newbies eyes I'm not sure how to define or register or whatever the required datasources with the container because I will never know for certain what db's are present.

Can someone help point me in the right direction? Can a person register JNDI stuff at runtime? How best to ensure I have connection pooling etc?

My end target should be full enterprise stability/scalability.

I may have posted this in the wrong forum, but this is my first post and I'm not sure of the 'pecking' order
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Let me get this straight:
You're completely new to Java, J2EE, JDBC and databases, yet you got yourself hired to create a completely new application using all those together?

Good luck... Better start learning, and learning fast.
JNDI sources typically need to be available at deployment time (or at least the names by which they're referenced, depending on the server they may be allowed to be unreachable at the time).
You can't just decide to make a call to something without defining first where that something may be found after all.

Connection pooling with J2EE is a requirement of the application server. If you use its mechanisms you should not need to bother about it at all.


42
Eric Schumacher
Greenhorn

Joined: Jun 02, 2004
Posts: 20
Jeroen, Thanks for the reply.

Originally posted by Jeroen Wenting:
[QB]Let me get this straight:
You're completely new to Java, J2EE, JDBC and databases, yet you got yourself hired to create a completely new application using all those together?

Not exactly. I'm doing this 'on the side' as a way to learn Java and to provide my company a cost effective (free-ish) solution...making my life easier in the long run. I work with VB mostly, but would like to explore this route.


Good luck... Better start learning, and learning fast.

Thanks. I'm working on it...though I need some sound advice from some friendly people to get me started.



JNDI sources typically need to be available at deployment time (or at least the names by which they're referenced, depending on the server they may be allowed to be unreachable at the time).
You can't just decide to make a call to something without defining first where that something may be found after all.

Connection pooling with J2EE is a requirement of the application server. If you use its mechanisms you should not need to bother about it at all.


Typically? Well, this is probably not a typical architecture setup. In my mind I'm thinking about a collection of datasource objects that get created at startup and added-to and subtracted-from maybe every 15 minuted. Then when my application needs to use one or more it looks to the collection. So I guess I'm wondering if I can have connection pooling (without thinking about it or implementing it myself) and datasources that get defined at runtime in some sort of a collection? Again I'm a newbie to Java so I may not be using the right terms.
 
Don't get me started about those stupid light bulbs.
 
subject: Best first steps for runtime datasources