/** * Convience method for ARRAY construction. * * <p>Compare and contrast with toORDINATE - which treats <code>Double.NaN</code> as<code>NULL * </code> */ protected final ARRAY toARRAY(double doubles[], String dataType) throws SQLException { ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor(dataType, connection); return new ARRAY(descriptor, connection, doubles); }
protected int[] asIntArray(ARRAY array, int DEFAULT) throws SQLException { if (array == null) return null; if (DEFAULT == 0) return array.getIntArray(); return asIntArray(array.getOracleArray(), DEFAULT); } /** Presents Datum[] as a int[] */
/** Presents array as a double[] */ protected double[] asDoubleArray(ARRAY array, final double DEFAULT) throws SQLException { if (array == null) return null; if (DEFAULT == 0) return array.getDoubleArray(); return asDoubleArray(array.getOracleArray(), DEFAULT); }
getTypeName(column.getMappedTypeCode()), oracleConnection); List<Object> columnData = rowArrays.get(i); ARRAY array = new ARRAY(type, oracleConnection, columnData.toArray(new Object[columnData.size()])); stmt.setObject(i + 1, array); int[] errors = errorsArray.getIntArray();
/** * @param rs result set of the dimension info query * @param column column of the dimension info * @return the envelope out of the dimension info (assumption: x before y or longitude before * latitude) or null, if no data is in the specified column * @throws SQLException if dimension info can not be parsed * @author Hendrik Peilke */ private Envelope decodeDiminfoEnvelope(ResultSet rs, int column) throws SQLException { ARRAY returnArray = (ARRAY) rs.getObject(column); if (returnArray == null) { throw new SQLException("no data inside the specified column"); } Datum data[] = returnArray.getOracleArray(); if (data.length < 2) { throw new SQLException("too little dimension information found in sdo_geom_metadata"); } Datum[] xInfo = ((STRUCT) data[0]).getOracleAttributes(); Datum[] yInfo = ((STRUCT) data[1]).getOracleAttributes(); Double minx = xInfo[1].doubleValue(); Double maxx = xInfo[2].doubleValue(); Double miny = yInfo[1].doubleValue(); Double maxy = yInfo[2].doubleValue(); return new Envelope(minx, maxx, miny, maxy); }
Datum[] arrMessage = message_display.getOracleArray();
/** Convience method for ARRAY construction. */ protected final ARRAY toARRAY(int ints[], String dataType) throws SQLException { ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor(dataType, connection); return new ARRAY(descriptor, connection, ints); }
protected int[] asIntArray( ARRAY array, int DEFAULT ) throws SQLException { if( array == null ) return null; if( DEFAULT == 0 ) return array.getIntArray(); return asIntArray( array.getOracleArray(), DEFAULT ); } /** Presents Datum[] as a int[] */
/** Presents array as a double[] */ protected double[] asDoubleArray( ARRAY array, final double DEFAULT ) throws SQLException { if( array == null ) return null; if( DEFAULT == 0 ) return array.getDoubleArray(); return asDoubleArray( array.getOracleArray(), DEFAULT ); }
protected final ARRAY toORDINATE(double ords[]) throws SQLException { ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor("MDSYS.SDO_ORDINATE_ARRAY", connection); final int LENGTH = ords.length; Datum data[] = new Datum[LENGTH]; for (int i = 0; i < LENGTH; i++) { data[i] = toNUMBER(ords[i]); } return new ARRAY(descriptor, connection, data); }
/** * Converts an Oracle <code>ARRAY</code> into a <code>int</code> array, * with a default value used to represent NULL values. * * @param array an Oracle ARRAY of integer values * @param defaultValue the value to use for NULL values * @return an array of ints * @throws SQLException if an error was encountered */ public static int[] toIntArray(ARRAY array, int defaultValue) throws SQLException { if (array == null) return null; if (defaultValue == 0) return array.getIntArray(); return toIntArray(array.getOracleArray(), defaultValue); }
/** Presents array as a double[] */ public static double[] toDoubleArray(ARRAY array, final double defaultValue) throws SQLException { if (array == null) return null; if (defaultValue == 0) return array.getDoubleArray(); return toDoubleArray(array.getOracleArray(), defaultValue); }
protected final ARRAY toATTRIBUTE(double ords[], String desc) throws SQLException { ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor(desc, connection); final int LENGTH = ords.length; Datum data[] = new Datum[LENGTH]; for (int i = 0; i < LENGTH; i++) { data[i] = toNUMBER(ords[i]); } return new ARRAY(descriptor, connection, data); }
return new ARRAY(descriptor, connection, data);
/** * Convience method for ARRAY construction. */ public static ARRAY toARRAY(int[] ints, String dataType, OracleConnection connection) throws SQLException { ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor(dataType, connection); return new ARRAY(descriptor, connection, ints); }
/** * Convience method for ARRAY construction. */ protected final ARRAY toARRAY( int ints[], String dataType ) throws SQLException { ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor( dataType, connection ); return new ARRAY( descriptor, connection, ints ); }
/** * Convience method for ARRAY construction. * </p> */ public static ARRAY toARRAY(double[] doubles, String dataType, OracleConnection connection) throws SQLException { ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor(dataType, connection); return new ARRAY(descriptor, connection, doubles); }
/** * Convience method for ARRAY construction. * <p> * Compare and contrast with toORDINATE - which treats <code>Double.NaN</code> * as<code>NULL</code></p> */ protected final ARRAY toARRAY( double doubles[], String dataType ) throws SQLException { ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor( dataType, connection ); return new ARRAY( descriptor, connection, doubles ); }
/** * INTERNAL: * Platforms that support java.sql.Array may override this method. * @return Array */ public Array createArray(String elementDataTypeName, Object[] elements, Connection connection) throws SQLException { return new oracle.sql.ARRAY(new oracle.sql.ArrayDescriptor(elementDataTypeName, connection), connection, elements); }
/** * INTERNAL: * Platforms that support java.sql.Array may override this method. * @return Array */ @Override public Array createArray(String elementDataTypeName, Object[] elements, Connection connection) throws SQLException { return new oracle.sql.ARRAY(new oracle.sql.ArrayDescriptor(elementDataTypeName, connection), connection, elements); }