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); }
/** * @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); }
/** 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 ); }
/** 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 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[] */
Datum[] arrMessage = message_display.getOracleArray();
/** * 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); }