if (resultMapName != null) {
resultMap = (BasicResultMap) vars.client.getDelegate().getResultMap(resultMapName);
}
vars.errorCtx.setMoreInfo("Check the parameter map name.");
BasicParameterMap parameterMap = null;
if (parameterMapName != null) {
parameterMap = (BasicParameterMap) vars.client.getDelegate().getParameterMap(parameterMapName);
}
statement.setId(id);
statement.setParameterMap(parameterMap);
statement.setResultMap(resultMap);
statement.setResource(vars.errorCtx.getResource());
if (resultSetType != null) {
if ("FORWARD_ONLY".equals(resultSetType)) {
statement.setResultSetType(new Integer(ResultSet.TYPE_FORWARD_ONLY));
} else if ("SCROLL_INSENSITIVE".equals(resultSetType)) {
statement.setResultSetType(new Integer(ResultSet.TYPE_SCROLL_INSENSITIVE));
} else if ("SCROLL_SENSITIVE".equals(resultSetType)) {
statement.setResultSetType(new Integer(ResultSet.TYPE_SCROLL_SENSITIVE));
}
}
if (fetchSize != null) {
statement.setFetchSize(new Integer(fetchSize));
}
// set parameter class either from attribute or from map (make sure to match)
if (parameterMap == null) {
try {
if (parameterClassName != null) {
vars.errorCtx.setMoreInfo("Check the parameter class.");
parameterClass = Resources.classForName(parameterClassName);
statement.setParameterClass(parameterClass);
}
} catch (ClassNotFoundException e) {
throw new SqlMapException("Error. Could not set parameter class. Cause: " + e, e);
}
} else {
statement.setParameterClass(parameterMap.getParameterClass());
}
try {
if (resultClassName != null) {
vars.errorCtx.setMoreInfo("Check the result class.");