@Test public void testConstantParameter() throws Exception { StatementParameter sp = new StatementParameter("hello", String.class.getName(), QueryType.constant, null, null); AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage(XpathMetadataServiceTest.XML); MyPreparedStatement stmt = new MyPreparedStatement(); stmt.clearParameters(); sp.apply(1, stmt, msg); assertEquals("hello", stmt.getParameter(1)); }
@Override public void apply(int parameterIndex, PreparedStatement statement, AdaptrisMessage msg) throws SQLException, ServiceException { Object queryValue = getQueryValue(msg); logger().log(parameterIndex, queryValue); statement.setObject(parameterIndex, this.convertToQueryClass(queryValue)); }
StatementParameter extends StatementParameterImpl { @Override public void apply(int parameterIndex, PreparedStatement statement, AdaptrisMessage msg) throws SQLException, ServiceException { Object queryValue = getQueryValue(msg); logger().log(parameterIndex, queryValue); statement.setObject(parameterIndex, this.convertToQueryClass(queryValue)); } }
StatementParameter extends StatementParameterImpl { @Override public void apply(int parameterIndex, PreparedStatement statement, AdaptrisMessage msg) throws SQLException, ServiceException { Object queryValue = getQueryValue(msg); logger().log(parameterIndex, queryValue); statement.setObject(parameterIndex, this.convertToQueryClass(queryValue)); } StatementParameter();  StatementParameter(String query, Class<?> clazz, QueryType type);  StatementParameter(String query, String classname, QueryType type);  StatementParameter(String query, String classname, QueryType type, Boolean nullConvert);  StatementParameter(String query, String classname, QueryType type, Boolean nullConvert, String paramName);  StatementParameter(String query, Class<?> clazz, QueryType type, Boolean nullConvert); }
StatementParameter extends StatementParameterImpl { @Override public void apply(int parameterIndex, PreparedStatement statement, AdaptrisMessage msg) throws SQLException, ServiceException { Object queryValue = getQueryValue(msg); logger().log(parameterIndex, queryValue); statement.setObject(parameterIndex, this.convertToQueryClass(queryValue)); } StatementParameter();  StatementParameter(String query, Class<?> clazz, QueryType type);  StatementParameter(String query, String classname, QueryType type);  StatementParameter(String query, String classname, QueryType type, Boolean nullConvert);  StatementParameter(String query, String classname, QueryType type, Boolean nullConvert, String paramName);  StatementParameter(String query, Class<?> clazz, QueryType type, Boolean nullConvert); @Override void apply(int parameterIndex, PreparedStatement statement, AdaptrisMessage msg); void setQueryClass(String clazz); String getQueryClass(); StatementParameter makeCopy(); }
StatementParameter extends StatementParameterImpl { @Override public void apply(int parameterIndex, PreparedStatement statement, AdaptrisMessage msg) throws SQLException, ServiceException { Object queryValue = getQueryValue(msg); logger().log(parameterIndex, queryValue); statement.setObject(parameterIndex, this.convertToQueryClass(queryValue)); } StatementParameter();  StatementParameter(String query, Class<?> clazz, QueryType type);  StatementParameter(String query, String classname, QueryType type);  StatementParameter(String query, String classname, QueryType type, Boolean nullConvert);  StatementParameter(String query, String classname, QueryType type, Boolean nullConvert, String paramName);  StatementParameter(String query, Class<?> clazz, QueryType type, Boolean nullConvert); @Override void apply(int parameterIndex, PreparedStatement statement, AdaptrisMessage msg); void setQueryClass(String clazz); String getQueryClass(); StatementParameter makeCopy();  }