Package java.sql

Examples of java.sql.Array


   */
  public Array getArray(int i) throws SQLException {
    synchronized (checkClosed().getConnectionMutex()) {
      ResultSetInternalMethods rs = getOutputParameters(i);
 
      Array retValue = rs.getArray(mapOutputParameterIndexToRsIndex(i));
 
      this.outputParamWasNull = rs.wasNull();
 
      return retValue;
    }
View Full Code Here


      throws SQLException {
    synchronized (checkClosed().getConnectionMutex()) {
      ResultSetInternalMethods rs = getOutputParameters(0); // definitely not going to be
      // from ?=
 
      Array retValue = rs.getArray(fixParameterName(parameterName));
 
      this.outputParamWasNull = rs.wasNull();
 
      return retValue;
    }
View Full Code Here

   * @see java.sql.CallableStatement#getArray(int)
   */
  public synchronized Array getArray(int i) throws SQLException {
    ResultSet rs = getOutputParameters(i);

    Array retValue = rs.getArray(mapOutputParameterIndexToRsIndex(i));

    this.outputParamWasNull = rs.wasNull();

    return retValue;
  }
View Full Code Here

  public synchronized Array getArray(String parameterName)
      throws SQLException {
    ResultSet rs = getOutputParameters(0); // definitely not going to be
    // from ?=

    Array retValue = rs.getArray(fixParameterName(parameterName));

    this.outputParamWasNull = rs.wasNull();

    return retValue;
  }
View Full Code Here

    }

    public void testSetArray() throws SQLException {
        BaseRowSetImpl brs = new BaseRowSetImpl();
        brs.initParams();
        Array a = new MockArray();
        brs.setArray(1, a);
        Object[] params = brs.getParams();
        assertNotNull(params);
        assertEquals(1, params.length);
        assertTrue("Should have stored a SerialArray",
View Full Code Here

    /**
     * @tests {@link javax.sql.rowset.serial.SQLOutputImpl#writeArray(Array)}
     */
    public void test_writeArrayLjava_sql_Array() throws SQLException {
        Array array = new MockArray();
        impl.writeArray(array);
        assertEquals(1, attr.size());
        assertTrue(attr.get(0) instanceof SerialArray);

        impl.writeArray(null);
View Full Code Here

                    agent_.logWriter_.traceEntry(this, "getArray", parameterIndex);
                }
                super.checkForClosedStatement();
                checkGetterPreconditions(parameterIndex);
                setWasNull(parameterIndex);
                Array result = wasNullX() ? null :
                    singletonRowData_.getArray(parameterIndex);

                if (true) {
                    throw new SqlException(agent_.logWriter_,
                        new ClientMessageId(SQLState.JDBC_METHOD_NOT_IMPLEMENTED));
View Full Code Here

            if (agent_.loggingEnabled()) {
                agent_.logWriter_.traceEntry(this, "getArray", column);
            }
            checkGetterPreconditions(column, "getArray");
            Array result = isNull(column) ? null : cursor_.getArray(column);
            if (true) {
                throw new SqlException(agent_.logWriter_,
                    new ClientMessageId(SQLState.JDBC_METHOD_NOT_IMPLEMENTED));
            }
            if (agent_.loggingEnabled()) {
View Full Code Here

            return (T) (string == null ? null : new ULong(string));
        }

        // The type byte[] is handled earlier. byte[][] can be handled here
        else if (type.isArray()) {
            Array result = stream.readArray();
            return (T) (result == null ? null : result.getArray());
        }
        else if (ArrayRecord.class.isAssignableFrom(type)) {
            return (T) getArrayRecord(configuration, stream.readArray(), (Class<? extends ArrayRecord<?>>) type);
        }
        else if (EnumType.class.isAssignableFrom(type)) {
View Full Code Here

        throws SQLException {

        ResultSet rs = ctx.resultSet();

        // Get the JDBC Array and check for null. If null, that's OK
        Array array = rs.getArray(index);
        if (array == null) {
            return null;
        }

        // Try fetching a Java Object[]. That's gonna work for non-UDT types
        try {
            return (T) convertArray(rs.getArray(index), (Class<? extends Object[]>) type);
        }

        // This might be a UDT (not implemented exception...)
        catch (Exception e) {
            List<Object> result = new ArrayList<Object>();

            // Try fetching the array as a JDBC ResultSet
            try {
                ctx.resultSet(array.getResultSet());
                while (ctx.resultSet().next()) {
                    result.add(getFromResultSet(ctx, type.getComponentType(), 2));
                }
            }
View Full Code Here

TOP

Related Classes of java.sql.Array

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.