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.proxy.backend.connector; 19 20 import org.apache.shardingsphere.proxy.backend.handler.data.DatabaseBackendHandler; 21 import org.apache.shardingsphere.proxy.backend.response.data.QueryResponseRow; 22 import org.apache.shardingsphere.proxy.backend.response.header.ResponseHeader; 23 24 import java.sql.ResultSet; 25 import java.sql.SQLException; 26 import java.sql.Statement; 27 28 /** 29 * Database connector. 30 */ 31 public interface DatabaseConnector extends DatabaseBackendHandler { 32 33 /** 34 * Add statement. 35 * 36 * @param statement statement to be added 37 */ 38 void add(Statement statement); 39 40 /** 41 * Add result set. 42 * 43 * @param resultSet result set to be added 44 */ 45 void add(ResultSet resultSet); 46 47 @Override 48 ResponseHeader execute() throws SQLException; 49 50 @Override 51 boolean next() throws SQLException; 52 53 @Override 54 QueryResponseRow getRowData() throws SQLException; 55 56 @Override 57 void close() throws SQLException; 58 }