All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jumpmind.db.sql.ISqlTemplate Maven / Gradle / Ivy

Go to download

This library is a fork of Apache DdlUtils. DdlUtils is a small, easy-to-use component for working with Database Definition (DDL) files.

There is a newer version: 3.5.19
Show newest version
/**
 * Licensed to JumpMind Inc under one or more contributor
 * license agreements.  See the NOTICE file distributed
 * with this work for additional information regarding
 * copyright ownership.  JumpMind Inc licenses this file
 * to you under the GNU General Public License, version 3.0 (GPLv3)
 * (the "License"); you may not use this file except in compliance
 * with the License.
 *
 * You should have received a copy of the GNU General Public License,
 * version 3.0 (GPLv3) along with this library; if not, see
 * .
 *
 * 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.
 */
package org.jumpmind.db.sql;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * This interface insulates the application from the data connection technology.
 */
public interface ISqlTemplate {

    @Deprecated
    public byte[] queryForBlob(String sql, Object... args);

    public byte[] queryForBlob(String sql, int jdbcTypeCode, String jdbcTypeName, Object... args);

    public String queryForClob(String sql, Object... args);

    public  T queryForObject(String sql, Class clazz, Object... params);
    
    public  T queryForObject(String sql, ISqlRowMapper mapper, Object... params);
    
    public int queryForInt(String sql, Map params);
    
    public int queryForInt(String sql, Object... args);
    
    public String queryForString(String sql, Object... args);

    public long queryForLong(String sql, Object... args);
    
    public Row queryForRow(String sql, Object... args);

    public Map queryForMap(String sql, Object... params);

    public  Map queryForMap(String sql, ISqlRowMapper mapper, String keyColumn,
            Object... args);
    
    public  Map queryForMap(String sql, String keyColumn, String valueColumn,
            Object... args);

    public  ISqlReadCursor queryForCursor(String sql, ISqlRowMapper mapper,
            Object[] params, int[] types);

    public  ISqlReadCursor queryForCursor(String sql, ISqlRowMapper mapper);

    public List query(String sql);

    public List query(String sql, Object[] params, int[] types);
    
    public List query(String sql, Object[] params);
    
    public  List query(String sql, ISqlRowMapper mapper, Map namedParams);

    public  List query(String sql, ISqlRowMapper mapper, Object... params);

    public  List query(String sql, ISqlRowMapper mapper, Object[] params, int[] types);
    
    public  List query(String sql, int maxRowsToFetch, ISqlRowMapper mapper, Object[] params, int[] types);
    
    public  List query(String sql, int maxRowsToFetch, ISqlRowMapper mapper, Object... params);
    
    public  List query(String sql, int maxRowsToFetch, ISqlRowMapper mapper, Map params);

    public  Map query(String sql, String keyCol, String valueCol, Object[] params,
            int[] types);

    public int update(boolean autoCommit, boolean failOnError, int commitRate, ISqlResultsListener listener, String... sql);
    
    public int update(boolean autoCommit, boolean failOnError, boolean failOnDrops, boolean failOnSequenceCreate, int commitRate, ISqlResultsListener listener, ISqlStatementSource source);
    
    public int update(boolean autoCommit, boolean failOnError, int commitRate, String... sql);

    public int update(String sql, Object[] values, int[] types);

    public int update(String sql, Object... values);

    public void testConnection();

    public SqlException translate(Throwable ex);
    
    public boolean isUniqueKeyViolation(Throwable ex);
    
    public boolean isForeignKeyViolation(Throwable ex);

    public ISqlTransaction startSqlTransaction();

    public int getDatabaseMajorVersion();

    public int getDatabaseMinorVersion();

    public String getDatabaseProductName();

    public String getDatabaseProductVersion();

    public String getDriverName();

    public String getDriverVersion();

    public Set getSqlKeywords();

    public boolean supportsGetGeneratedKeys();
    
    public boolean isStoresUpperCaseIdentifiers();
    
    public boolean isStoresLowerCaseIdentifiers();
    
    public boolean isStoresMixedCaseQuotedIdentifiers();

    public long insertWithGeneratedKey(final String sql, String column, final String sequenceName,
            final Object[] args, final int[] types);    

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy