The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

EJB db connection

Posted by Raji on November 27, 2000 at 10:05 AM

From my initial understanding with EJBs, I don't think that will work. A pool of connections need to be set up for the server to know which one to use. This is done via a proerties file. Or if you don't want to do that, you will have to construct a Properties object having the pool of connections,etc. (although why would you want to do that when the server can do that job for you just be specifying in a file).

But I've just done some basic EJB work and there may be someother way to do this.

Raji

> hi raji,
> thanx for responding...I would like to explain in detail what is going on....

> i have not mapped anything to the property file. All i have done is try to connect to the database as u would normally do if u wrote a java program. I do this in setentitycontext(). Later in ejbcreate() i just execute an insert statement. All this is fine in the sense that the bean is successfully compiled and even deployed. the problem arises when a client tries to create the bean. I have debugged the bean code at runtime and (putting println statements) and found the bean's setentitycontext is being called successfully by the client program and that when the getconnection() method is called, it gives driver not found exception.....However the same driver (jdbc-odbc brige) is able to retrieve data when used in a normal java program. What could be the problem????

> thanx again
> abcd






Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us