Class J2eeConnection
- java.lang.Object
-
- com.aquima.interactions.foundation.connectivity.impl.J2eeConnection
-
- All Implemented Interfaces:
IConnection
,ISqlConnection
public class J2eeConnection extends Object implements ISqlConnection
SQL connection implementation for a J2EE environment.- Since:
- 6.3
- Author:
- O. Kerpershoek
-
-
Constructor Summary
Constructors Constructor Description J2eeConnection(String name, String jndiName)
Constructs the connection with a name and jndi-name.J2eeConnection(String name, DataSource datasource)
Constructs the connection with a name and DataSource implementation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IQuery
createQuery(String queryStr)
This method may be used to create a query object for the SQL connection.IQuery
createQuery(String queryStr, String pk)
This method may be used to create an INSERT query from which an auto-generated value must be retrieved usingIQuery.getIdentity()
.DataSource
getDataSource()
String
getName()
This method returns the name of the connection object.ConnectionType
getType()
This method returns the type of the connection object.
-
-
-
Constructor Detail
-
J2eeConnection
public J2eeConnection(String name, DataSource datasource)
Constructs the connection with a name and DataSource implementation.- Parameters:
name
- The name of the connection.datasource
- The datasource that should be used to connect to the database.
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:IConnection
This method returns the name of the connection object. The name is used to uniquely identify the connection object.- Specified by:
getName
in interfaceIConnection
- Returns:
- the name of the connection object.
-
getType
public ConnectionType getType()
Description copied from interface:IConnection
This method returns the type of the connection object.- Specified by:
getType
in interfaceIConnection
- Returns:
- the type of the connection object.
-
createQuery
public IQuery createQuery(String queryStr)
Description copied from interface:ISqlConnection
This method may be used to create a query object for the SQL connection.- Specified by:
createQuery
in interfaceISqlConnection
- Parameters:
queryStr
- The query string that should be used by the query object.- Returns:
- Query object for the provided query string.
-
createQuery
public IQuery createQuery(String queryStr, String pk)
Description copied from interface:ISqlConnection
This method may be used to create an INSERT query from which an auto-generated value must be retrieved usingIQuery.getIdentity()
.- Specified by:
createQuery
in interfaceISqlConnection
- Parameters:
queryStr
- the query string that should be used by the query object.pk
- the name of the primary key column whose value is auto-generated by the database- Returns:
- the query object for the provided query string.
-
getDataSource
public DataSource getDataSource()
-
-