I have several individual Java programs, and they each have their own database connection pool. Is there a way that I can have a shared connection pool among all my Java programs? JNDI?
RMI would work I suppose, but thats a lot of effort to just have them all share a DB connection pool. Couple of questions first before I can say if RMI would be worth it. Are all of your programs independant of each other(you start them all with their own JVM)? Or can you meld them all together into a single program that can run them all at once? If you can meld them, then your problem is solved with a single DB connection pool that they all share. If they are not meldable, then you are incurring a lot of overhead anyways with the multiple JVMs running at once and pooling DB connections is most likely a minor issue. Are the programs being run on separate machines? If they are, then RMI may indeed be your best solution with a server set up to handle all db transactions. If you have many different transaction types, tho, you will most likely have to set up a method for each type of transaction you are wanting to do since you probably can't actually pass a ResultSet back through RMI since it is dependant on the DB being there when you try to access the values the resultSet points to. Not sure if this helps you much, but it will give you somethign to think about. Chris