public String toString() { return "=> " + getOutputField().getName(); } }
public OutputParameterForCallableStatement(DatabaseField field, DatabasePlatform platform, boolean isCursor) { this(field); this.isCursor = isCursor; prepare(platform); }
public String toString() { String strIn; if (inParameter instanceof DatabaseField) { strIn = "null"; } else { strIn = inParameter.toString(); } return strIn + " " + super.toString(); } }
/** * INTERNAL: * Return DatabaseRow containing output fields and values. * Called only if shouldBuildOutputRow method returns true. */ public AbstractRecord buildOutputRow(CallableStatement statement) throws SQLException { AbstractRecord row = new DatabaseRecord(); for (int index = 0; index < parameters.size(); index++) { Object parameter = parameters.elementAt(index); if (parameter instanceof OutputParameterForCallableStatement) { OutputParameterForCallableStatement outParameter = (OutputParameterForCallableStatement)parameter; if (!outParameter.isCursor()) { Object value = statement.getObject(index + 1); DatabaseField field = outParameter.getOutputField(); row.put(field, value); } } } return row; }
public void set(DatabasePlatform platform, PreparedStatement statement, int index, AbstractSession session) throws SQLException { platform.setParameterValueInDatabaseCall(inParameter, statement, index, session); super.set(platform, statement, index, session); }
/** * INTERNAL: * Return 1-based index of out cursor parameter, or -1. */ public int getCursorOutIndex() { for (int i = 0; i < getParameters().size(); i++) { Object parameter = getParameters().elementAt(i); if (parameter instanceof OutputParameterForCallableStatement) { if (((OutputParameterForCallableStatement)parameter).isCursor()) { return i + 1; } } } return -1; }
OutputParameterForCallableStatement outParameter = new OutputParameterForCallableStatement(outField, session.getPlatform()); ((Object[])parameter)[1] = outParameter; OutputParameterForCallableStatement outParameter = new OutputParameterForCallableStatement(outField, session.getPlatform(), isCursor); getParameters().setElementAt(outParameter, i);
public void prepare(DatabasePlatform platform) { if (isCursor()) { jdbcType = platform.getCursorCode();// Oracle code for cursors } else { jdbcType = platform.getJDBCType(getOutputField()); isTypeNameRequired = platform.requiresTypeNameToRegisterOutputParameter(); if (isTypeNameRequired) { typeName = platform.getJdbcTypeName(jdbcType); } } }