DatabaseCommunicationEngine.java 1.6 KB
Newer Older
T
terrymanu 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

18
package org.apache.shardingsphere.proxy.backend.communication;
T
terrymanu 已提交
19

20 21
import org.apache.shardingsphere.proxy.backend.response.BackendResponse;
import org.apache.shardingsphere.proxy.backend.response.query.QueryData;
T
terrymanu 已提交
22 23 24 25

import java.sql.SQLException;

/**
T
terrymanu 已提交
26
 * Database communication engine.
T
terrymanu 已提交
27
 */
T
terrymanu 已提交
28
public interface DatabaseCommunicationEngine {
T
terrymanu 已提交
29 30
    
    /**
31
     * Execute to database.
T
terrymanu 已提交
32
     *
33
     * @return backend response
L
Liang Zhang 已提交
34
     * @throws SQLException SQL exception
T
terrymanu 已提交
35
     */
L
Liang Zhang 已提交
36
    BackendResponse execute() throws SQLException;
T
terrymanu 已提交
37 38 39 40 41 42 43 44 45 46
    
    /**
     * Goto next result value.
     *
     * @return has more result value or not
     * @throws SQLException SQL exception
     */
    boolean next() throws SQLException;
    
    /**
T
terrymanu 已提交
47
     * Get query data.
T
terrymanu 已提交
48
     *
T
terrymanu 已提交
49
     * @return query data
T
terrymanu 已提交
50 51
     * @throws SQLException SQL exception
     */
T
terrymanu 已提交
52
    QueryData getQueryData() throws SQLException;
T
terrymanu 已提交
53
}