@Override public Array createSerial(Array array) throws SQLException { return new SerialArray(array); } }
/** * Retrieves the DBMS-specific type name for the elements in this * <code>SerialArray</code> object. * * @return the SQL type name used by the DBMS for the base type of this * <code>SerialArray</code> object * @throws SerialException if an error occurs; * if {@code free} had previously been called on this object */ public String getBaseTypeName() throws SerialException { isValid(); return baseTypeName; }
/** * Writes an <code>Array</code> object in the Java * programming language to this <code>SQLOutputImpl</code> * object. The driver converts this value to a serializable * <code>SerialArray</code> SQL <code>ARRAY</code> * value before returning it to the database. * * @param x an object representing an SQL <code>ARRAY</code> value * @throws SQLException if the <code>SQLOutputImpl</code> object is in * use by a <code>SQLData</code> object attempting to write the attribute * values of a UDT to the database. */ @SuppressWarnings("unchecked") public void writeArray(Array x) throws SQLException { if (x == null) { attribs.add(null); } else { attribs.add(new SerialArray(x, map)); } }
/** * Retrieves the SQL type of the elements in this <code>SerialArray</code> * object. The <code>int</code> returned is one of the constants in the class * <code>java.sql.Types</code>. * * @return one of the constants in <code>java.sql.Types</code>, indicating * the SQL type of the elements in this <code>SerialArray</code> object * @throws SerialException if an error occurs; * if {@code free} had previously been called on this object */ public int getBaseType() throws SerialException { isValid(); return baseType; }
public void setArray(int parameterIndex, Array x) throws SQLException { if (x instanceof ArrayImpl) { setObject(parameterIndex, x); } else { setObject(parameterIndex, new SerialArray(x)); } }
/** * Returns a new array that is a copy of this <code>SerialArray</code> * object. * * @return a copy of this <code>SerialArray</code> object as an * <code>Object</code> in the Java programming language * @throws SerialException if an error occurs; * if {@code free} had previously been called on this object */ public Object getArray() throws SerialException { isValid(); Object dst = new Object[len]; System.arraycopy((Object)elements, 0, dst, 0, len); return dst; }
public void setArray(int parameterIndex, Array x) throws SQLException { if (x instanceof ArrayImpl) { setObject(parameterIndex, x); } else { setObject(parameterIndex, new SerialArray(x)); } }
/** * Returns a new array that is a copy of a slice * of this <code>SerialArray</code> object, starting with the * element at the given index and containing the given number * of consecutive elements. * * @param index the index into this <code>SerialArray</code> object * of the first element to be copied; * the index of the first element is <code>0</code> * @param count the number of consecutive elements to be copied, starting * at the given index * @return a copy of the designated elements in this <code>SerialArray</code> * object as an <code>Object</code> in the Java programming language * @throws SerialException if an error occurs; * if {@code free} had previously been called on this object */ public Object getArray(long index, int count) throws SerialException { isValid(); Object dst = new Object[count]; System.arraycopy((Object)elements, (int)index, dst, 0, count); return dst; }
throw new SQLException("Set initParams() before setArray"); params.put(Integer.valueOf(parameterIndex - 1), new SerialArray(array));
/** * Returns a new array that is a copy of this <code>SerialArray</code> * object, using the given type map for the custom * mapping of each element when the elements are SQL UDTs. * <P> * This method does custom mapping if the array elements are a UDT * and the given type map has an entry for that UDT. * Custom mapping is recursive, * meaning that if, for instance, an element of an SQL structured type * is an SQL structured type that itself has an element that is an SQL * structured type, each structured type that has a custom mapping will be * mapped according to the given type map. * * @param map a <code>java.util.Map</code> object in which * each entry consists of 1) a <code>String</code> object * giving the fully qualified name of a UDT and 2) the * <code>Class</code> object for the <code>SQLData</code> implementation * that defines how the UDT is to be mapped * @return a copy of this <code>SerialArray</code> object as an * <code>Object</code> in the Java programming language * @throws SerialException if an error occurs; * if {@code free} had previously been called on this object */ public Object getArray(Map<String, Class<?>> map) throws SerialException { isValid(); Object dst[] = new Object[len]; System.arraycopy((Object)elements, 0, dst, 0, len); return dst; }
getCurrentRow().setColumnObject(columnIndex, new SerialArray(a));
throws SerialException isValid(); Object dst = new Object[count]; System.arraycopy((Object)elements, (int)index, dst, 0, count);
} else if (obj instanceof java.sql.Array) { if(map != null) obj = new SerialArray((java.sql.Array)obj, map); else obj = new SerialArray((java.sql.Array)obj);
attribs[i] = new SerialRef((Ref)attribs[i]); } else if (attribs[i] instanceof java.sql.Array) { attribs[i] = new SerialArray((java.sql.Array)attribs[i], map);
rsval = new SerialClob((Clob)rsval); } else if (rsval instanceof java.sql.Array) { rsval = new SerialArray((java.sql.Array)rsval, map);
obj = new SerialClob((Clob)obj); } else if (obj instanceof java.sql.Array) { obj = new SerialArray((java.sql.Array)obj, map);
elements[i] = new SerialArray((Array)elements[i], map);