1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 package org.apache.shardingsphere.infra.merge.result; 19 20 import java.io.InputStream; 21 import java.io.Reader; 22 import java.sql.SQLException; 23 import java.util.Calendar; 24 25 /** 26 * Merged result after merge engine. 27 */ 28 public interface MergedResult { 29 30 /** 31 * Iterate next data. 32 * 33 * @return has next data 34 * @throws SQLException SQL exception 35 */ 36 boolean next() throws SQLException; 37 38 /** 39 * Get data value. 40 * 41 * @param columnIndex column index 42 * @param type class type of data value 43 * @return data value 44 * @throws SQLException SQL exception 45 */ 46 Object getValue(int columnIndex, Class<?> type) throws SQLException; 47 48 /** 49 * Get calendar value. 50 * 51 * @param columnIndex column index 52 * @param type class type of data value 53 * @param calendar calendar 54 * @return calendar value 55 * @throws SQLException SQL exception 56 */ 57 Object getCalendarValue(int columnIndex, Class<?> type, Calendar calendar) throws SQLException; 58 59 /** 60 * Get InputStream. 61 * 62 * @param columnIndex column index 63 * @param type class type of data value 64 * @return InputStream 65 * @throws SQLException SQL exception 66 */ 67 InputStream getInputStream(int columnIndex, String type) throws SQLException; 68 69 /** 70 * Get CharacterStream. 71 * 72 * @param columnIndex column index 73 * @return Reader 74 * @throws SQLException SQL exception 75 */ 76 Reader getCharacterStream(int columnIndex) throws SQLException; 77 78 /** 79 * Judge ResultSet is null or not. 80 * 81 * @return ResultSet is null or not 82 * @throws SQLException SQL exception 83 */ 84 boolean wasNull() throws SQLException; 85 }