Package com.adaptris.core.services.jdbc
Class StatementParameter
- java.lang.Object
-
- com.adaptris.core.services.jdbc.NamedStatementParameter
-
- com.adaptris.core.services.jdbc.StatementParameterImpl
-
- com.adaptris.core.services.jdbc.StatementParameter
-
- All Implemented Interfaces:
JdbcStatementParameter
public class StatementParameter extends StatementParameterImpl
Encapsulates a parameter that is used by the JdbcDataCaptureService.In the adapter configuration file this class is aliased as jdbc-statement-parameter which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.adaptris.core.services.jdbc.StatementParameterImpl
StatementParameterImpl.QueryType
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.services.jdbc.NamedStatementParameter
log
-
-
Constructor Summary
Constructors Constructor Description StatementParameter()StatementParameter(java.lang.String query, java.lang.Class<?> clazz, StatementParameterImpl.QueryType type)StatementParameter(java.lang.String query, java.lang.Class<?> clazz, StatementParameterImpl.QueryType type, java.lang.Boolean nullConvert)StatementParameter(java.lang.String query, java.lang.String classname, StatementParameterImpl.QueryType type)StatementParameter(java.lang.String query, java.lang.String classname, StatementParameterImpl.QueryType type, java.lang.Boolean nullConvert)StatementParameter(java.lang.String query, java.lang.String classname, StatementParameterImpl.QueryType type, java.lang.Boolean nullConvert, java.lang.String paramName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(int parameterIndex, java.sql.PreparedStatement statement, AdaptrisMessage msg)Apply this statement parameter to thePreparedStatement.protected java.lang.ObjectconvertToQueryClass(java.lang.Object value)Convert the given string to the corresponding query class.java.lang.StringgetQueryClass()Return the type of the underlying jdbc object.StatementParametermakeCopy()Make a copy of the statement parameter.voidsetQueryClass(java.lang.String clazz)The type of underlying jdbc object.-
Methods inherited from class com.adaptris.core.services.jdbc.StatementParameterImpl
convertNull, getConvertNull, getHandler, getParameterLogger, getQueryString, getQueryType, getQueryValue, logger, setConvertNull, setParameterLogger, setQueryString, setQueryType
-
Methods inherited from class com.adaptris.core.services.jdbc.NamedStatementParameter
getName, setName
-
-
-
-
Constructor Detail
-
StatementParameter
public StatementParameter()
-
StatementParameter
public StatementParameter(java.lang.String query, java.lang.Class<?> clazz, StatementParameterImpl.QueryType type)
-
StatementParameter
public StatementParameter(java.lang.String query, java.lang.String classname, StatementParameterImpl.QueryType type)
-
StatementParameter
public StatementParameter(java.lang.String query, java.lang.String classname, StatementParameterImpl.QueryType type, java.lang.Boolean nullConvert)
-
StatementParameter
public StatementParameter(java.lang.String query, java.lang.String classname, StatementParameterImpl.QueryType type, java.lang.Boolean nullConvert, java.lang.String paramName)
-
StatementParameter
public StatementParameter(java.lang.String query, java.lang.Class<?> clazz, StatementParameterImpl.QueryType type, java.lang.Boolean nullConvert)
-
-
Method Detail
-
apply
public void apply(int parameterIndex, java.sql.PreparedStatement statement, AdaptrisMessage msg) throws java.sql.SQLException, ServiceExceptionDescription copied from interface:JdbcStatementParameterApply this statement parameter to thePreparedStatement.- Parameters:
parameterIndex- the index in thePreparedStatementstatement- thePreparedStatementmsg- the AdaptrisMessage- Throws:
java.sql.SQLException- on exceptionServiceException
-
setQueryClass
public void setQueryClass(java.lang.String clazz)
The type of underlying jdbc object.- Parameters:
clazz- the clas type.
-
getQueryClass
public java.lang.String getQueryClass()
Return the type of the underlying jdbc object.- Returns:
- the type.
-
convertToQueryClass
protected java.lang.Object convertToQueryClass(java.lang.Object value) throws ServiceExceptionConvert the given string to the corresponding query class.- Parameters:
value- the string obtained.- Returns:
- an Object suitable for use in the service.
- Throws:
ServiceException- on error.
-
makeCopy
public StatementParameter makeCopy()
Description copied from interface:JdbcStatementParameterMake a copy of the statement parameter.- Returns:
- a copy (might be a clone, it might not).
-
-