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.executor.sql.execute.result.query; 19 20 import java.sql.SQLException; 21 22 /** 23 * Query result meta data. 24 */ 25 public interface QueryResultMetaData { 26 27 /** 28 * Get column count. 29 * 30 * @return column count 31 * @throws SQLException SQL exception 32 */ 33 int getColumnCount() throws SQLException; 34 35 /** 36 * Get table name. 37 * 38 * @param columnIndex column index 39 * @return table name 40 * @throws SQLException SQL exception 41 */ 42 String getTableName(int columnIndex) throws SQLException; 43 44 /** 45 * Get column name. 46 * 47 * @param columnIndex column index 48 * @return column name 49 * @throws SQLException SQL exception 50 */ 51 String getColumnName(int columnIndex) throws SQLException; 52 53 /** 54 * Get column label. 55 * 56 * @param columnIndex column index 57 * @return column label 58 * @throws SQLException SQL exception 59 */ 60 String getColumnLabel(int columnIndex) throws SQLException; 61 62 /** 63 * Get column type. 64 * 65 * @param columnIndex column index 66 * @return column type 67 * @throws SQLException SQL exception 68 */ 69 int getColumnType(int columnIndex) throws SQLException; 70 71 /** 72 * Get column type name. 73 * 74 * @param columnIndex column index 75 * @return column type name 76 * @throws SQLException SQL exception 77 */ 78 String getColumnTypeName(int columnIndex) throws SQLException; 79 80 /** 81 * Get column length. 82 * 83 * @param columnIndex column index 84 * @return column length 85 * @throws SQLException SQL exception 86 */ 87 int getColumnLength(int columnIndex) throws SQLException; 88 89 /** 90 * Get decimals. 91 * 92 * @param columnIndex column index 93 * @return decimals 94 * @throws SQLException SQL exception 95 */ 96 int getDecimals(int columnIndex) throws SQLException; 97 98 /** 99 * Is signed. 100 * 101 * @param columnIndex column index 102 * @return signed or not 103 * @throws SQLException SQL exception 104 */ 105 boolean isSigned(int columnIndex) throws SQLException; 106 107 /** 108 * Is not null. 109 * 110 * @param columnIndex column index 111 * @return not null or null 112 * @throws SQLException SQL exception 113 */ 114 boolean isNotNull(int columnIndex) throws SQLException; 115 116 /** 117 * Is auto increment. 118 * 119 * @param columnIndex column index 120 * @return auto increment or not 121 * @throws SQLException SQL exception 122 */ 123 boolean isAutoIncrement(int columnIndex) throws SQLException; 124 }