In the serverside,I want to get some information from database. This function does'nt need to participate in any transaction. and It will not be accessed by remote client, just by session bean.
which technology shall I use, ejb or java bean?
For simple, read-only logic, I prefer to use a JavaBean instead of an Entity Bean.
The pattern "JDBC for Reading" together with "DTOFactory" and "DTO RowSets".
Basically, you`ll have a direct access without the cost of building collection of objects, instead, you`ll trasnfer the data rows as they are from db.
A good reference is "EJB Design Patterns".