Harpal,
Your problem sounds more like a classpath problem to me (based on the error you say you are getting with SQL7), but here is something I have that works for me. First, I do all my SQL interaction in a helper class, not in the bean class itself. The bean can then focus on being a bean, and not worry about all that database stuff. For example, the getCustomerName method of my session bean:
The "helper" is a private variable of my CustomerEJB that is instantiated in the ejbCreate() method. The helper.getCustomerName(id) method then looks like this:
Finally, my helper.getConnection() method simply returns a JDBC connection:
Hope this helps a little. But I still think you need to make sure you have the JDBC classes in your CLASSPATH first. Can you get a connection and execute a statement in your
java code at all, or just not in your bean?
Good luck,
Bill
[This message has been edited by Bill Pearce (edited February 13, 2001).]
[This message has been edited by Bill Pearce (edited February 13, 2001).]
[This message has been edited by Bill Pearce (edited February 13, 2001).]