001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     *
009     *      http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    package org.apache.servicemix.jdbc;
018    
019    import java.io.IOException;
020    import java.sql.Connection;
021    import java.sql.SQLException;
022    
023    public interface JDBCAdapter {
024    
025        void doCreateTables(Connection connection) throws SQLException, IOException;
026        
027        void doDropTables(Connection connection) throws SQLException, IOException;
028        
029        byte[] doLoadData(Connection connection, String id) throws SQLException, IOException;
030        
031        byte[][] doLoadData(Connection connection, String[] ids) throws SQLException, IOException;
032        
033        void doStoreData(Connection connection, String id, byte[] data) throws SQLException, IOException;
034        
035        void doUpdateData(Connection connection, String id, byte[] data) throws SQLException, IOException;
036        
037        void doRemoveData(Connection connection, String id) throws SQLException, IOException;
038        
039        void doRemoveData(Connection connection, String[] ids) throws SQLException, IOException;
040        
041        int doGetCount(Connection connection) throws SQLException, IOException;
042        
043        String[] doGetIds(Connection connection) throws SQLException, IOException;
044        
045        String[] doGetIds(Connection connection, int fromIndex, int toIndex) throws SQLException, IOException;
046        
047        Statements getStatements();
048        
049        void setStatements(Statements statements);
050        
051    }