|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openxava.ejbx.EJB11Context
public class EJB11Context
Implementation of IEJBContext for a EJB 1.1 server.
Since EJB 1.1 standardizes enough things only it's needed one version,
and it is not required additional properties files.
If you can use getConnection() without argument, you need to define
in the bean a property named DATA_SOURCE that indicate the default data source.
In the DATA_SOURCE property you can put also the username and password by default,
thus datasource;usuario;clave.
| Constructor Summary | |
|---|---|
EJB11Context()
|
|
| Method Summary | |
|---|---|
java.security.Principal |
getCallerPrincipal()
As EJBContext.getCallerPrincipal in EJB 1.1. |
java.sql.Connection |
getConnection()
The connection is obtained from data source defined in DATA_SOURCE property of bean. |
java.sql.Connection |
getConnection(java.lang.String name)
Returns a JDBC connection from a identifier. |
java.lang.String |
getProperty(java.lang.String name)
Property value from name. |
boolean |
isCallerInRole(java.lang.String roleName)
As EJBContext.isCallerInRole in EJB 1.1. |
void |
setDefaultDataSource(java.lang.String dataSourceName)
Sets the datasource name used when using IConnectionProvider.getConnection(). |
void |
setEJBContext(EJBContext ejbContext)
Sets a EJBContext needed for implementing. |
void |
setPassword(java.lang.String password)
Sets password used to create connection. |
void |
setUser(java.lang.String user)
Sets the user used to craete the connection. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EJB11Context()
| Method Detail |
|---|
public java.security.Principal getCallerPrincipal()
IEJBContextEJBContext.getCallerPrincipal in EJB 1.1.
getCallerPrincipal in interface IEJBContext
public java.sql.Connection getConnection()
throws java.sql.SQLException
getConnection in interface IConnectionProviderjava.sql.SQLException - If there are problem obtaining the connetion
public java.sql.Connection getConnection(java.lang.String name)
throws java.sql.SQLException
IConnectionProvider
getConnection in interface IConnectionProvidername - Name of data source from what I obtain the connection
java.sql.SQLException - If there are problem obtaining the connetionpublic java.lang.String getProperty(java.lang.String name)
IEJBContextnull if the property
does not exist or it is not possible obtain it.
getProperty in interface IEJBContextpublic boolean isCallerInRole(java.lang.String roleName)
IEJBContextEJBContext.isCallerInRole in EJB 1.1.
isCallerInRole in interface IEJBContextpublic void setPassword(java.lang.String password)
IConnectionProvider *
Must to call to IConnectionProvider.setUser(java.lang.String) too. Although set user and password
is not mandatory.
setPassword in interface IConnectionProviderpublic void setDefaultDataSource(java.lang.String dataSourceName)
IConnectionProviderIConnectionProvider.getConnection().
setDefaultDataSource in interface IConnectionProviderpublic void setEJBContext(EJBContext ejbContext)
IEJBContextInitEJBContext needed for implementing. IEJBContext can be used.
setEJBContext in interface IEJBContextInitpublic void setUser(java.lang.String user)
IConnectionProvider
It is not mandatory to call this method.
setUser in interface IConnectionProvider
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||