didongusa
发贴: 64
积分: 0
|
于 2004-09-23 09:39
If you need Tomcat, that means the Hibernate objects still need container.
I confused the Tomcat was used for holding Servlets, I just guess they don't manage Hibernate objects.
For example, I have a table called "Test" with one colume:
"col1" datatype is "varchar2(100)".
The database is in a remote node.
Currently I have a node, this is my EJB container, I have a stateless session bean with remote "Hello", and the bean class is "HelloBean". I need to implement a business method named: "public void hello (String s)" inside "HelloBean" and exposed to "Hello", when client invoke 'hello("Hello World.");', I want to insert one row of data "Hello World." into the table "Test".
My first question is: The Hibernate has hundreds classes, where I put those library classes? If the EJB container have to know all the classes.
My second question is: If I need JDBC connection from
public void hello(String s) {
// JDBC needed here to insert.
}
How I get the "Connection" object?
Thanks. I just interested to know how the links are implemented: 3) Session Bean <-> DAO <-> Hibernate <-> DB
|