public float getFloat(int parameterIndex) throws SQLException { checkClosed(); checkIndex(parameterIndex, Types.REAL, "Float"); if (callResult[parameterIndex - 1] == null) { return 0; } return (Float) callResult[parameterIndex - 1]; }
public Object getObject(int i, Map<String, Class<?>> map) throws SQLException { return getObjectImpl(i, map); }
public void registerOutParameter(int parameterIndex, int sqlType, int scale) throws SQLException { // ignore scale for now registerOutParameter(parameterIndex, sqlType); } }
private void checkIndex(int parameterIndex) throws SQLException { checkIndex(parameterIndex, true); }
public Object getObjectImpl(int i, Map<String, Class<?>> map) throws SQLException { if (map == null || map.isEmpty()) { return getObject(i); } throw Driver.notImplemented(this.getClass(), "getObjectImpl(int,Map)"); }
@Override public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { checkClosed(); return new PgCallableStatement(this, sql, resultSetType, resultSetConcurrency, resultSetHoldability); }
public int executeUpdate() throws SQLException { if (isFunction) { executeWithFlags(0); return 0; } return super.executeUpdate(); }
checkClosed(); rs = result.getResultSet();
/** * Helper function for the getXXX calls to check isFunction and index == 1. * * @param parameterIndex parameter index (1-based) * @param type type * @param getName getter name * @throws SQLException if given index is not valid */ protected void checkIndex(int parameterIndex, int type, String getName) throws SQLException { checkIndex(parameterIndex); if (type != this.testReturn[parameterIndex - 1]) { throw new PSQLException( GT.tr("Parameter of type {0} was registered, but call to get{1} (sqltype={2}) was made.", "java.sql.Types=" + testReturn[parameterIndex - 1], getName, "java.sql.Types=" + type), PSQLState.MOST_SPECIFIC_TYPE_DOES_NOT_MATCH); } }
public <T> T getObject(int parameterIndex, Class<T> type) throws SQLException { if (type == ResultSet.class) { return type.cast(getObject(parameterIndex)); } throw new PSQLException(GT.tr("Unsupported type conversion to {1}.", type), PSQLState.INVALID_PARAMETER_VALUE); }
public java.math.BigDecimal getBigDecimal(int parameterIndex) throws SQLException { checkClosed(); checkIndex(parameterIndex, Types.NUMERIC, "BigDecimal"); return ((BigDecimal) callResult[parameterIndex - 1]); }
/** * helperfunction for the getXXX calls to check isFunction and index == 1 Compare BOTH type fields * against the return type. * * @param parameterIndex parameter index (1-based) * @param type1 type 1 * @param type2 type 2 * @param getName getter name * @throws SQLException if something goes wrong */ protected void checkIndex(int parameterIndex, int type1, int type2, String getName) throws SQLException { checkIndex(parameterIndex); if (type1 != this.testReturn[parameterIndex - 1] && type2 != this.testReturn[parameterIndex - 1]) { throw new PSQLException( GT.tr("Parameter of type {0} was registered, but call to get{1} (sqltype={2}) was made.", "java.sql.Types=" + testReturn[parameterIndex - 1], getName, "java.sql.Types=" + type1), PSQLState.MOST_SPECIFIC_TYPE_DOES_NOT_MATCH); } }
public Object getObject(String s, Map<String, Class<?>> map) throws SQLException { return getObjectImpl(s, map); }
public byte[] getBytes(int parameterIndex) throws SQLException { checkClosed(); checkIndex(parameterIndex, Types.VARBINARY, Types.BINARY, "Bytes"); return ((byte[]) callResult[parameterIndex - 1]); }
public SQLXML getSQLXML(int parameterIndex) throws SQLException { checkClosed(); checkIndex(parameterIndex, Types.SQLXML, "SQLXML"); return (SQLXML) callResult[parameterIndex - 1]; }
public BigDecimal getBigDecimal(int parameterIndex, int scale) throws SQLException { checkClosed(); checkIndex(parameterIndex, Types.NUMERIC, "BigDecimal"); return ((BigDecimal) callResult[parameterIndex - 1]); }
public String getString(int parameterIndex) throws SQLException { checkClosed(); checkIndex(parameterIndex, Types.VARCHAR, "String"); return (String) callResult[parameterIndex - 1]; }
public long getLong(int parameterIndex) throws SQLException { checkClosed(); checkIndex(parameterIndex, Types.BIGINT, "Long"); if (callResult[parameterIndex - 1] == null) { return 0; } return (Long) callResult[parameterIndex - 1]; }
public double getDouble(int parameterIndex) throws SQLException { checkClosed(); checkIndex(parameterIndex, Types.DOUBLE, "Double"); if (callResult[parameterIndex - 1] == null) { return 0; } return (Double) callResult[parameterIndex - 1]; }
public java.sql.Date getDate(int parameterIndex) throws SQLException { checkClosed(); checkIndex(parameterIndex, Types.DATE, "Date"); return (java.sql.Date) callResult[parameterIndex - 1]; }