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

com.cudrania.jdbc.query.SqlQueryBuilder Maven / Gradle / Ivy

There is a newer version: 1.2.7
Show newest version
package com.cudrania.jdbc.query;

import com.cudrania.jdbc.sql.SqlStatement;

import javax.sql.DataSource;

/**
 * 数据库访问接口实现,该类是线程安全的
 *
 * @author skyfalling
 */
public class SqlQueryBuilder {
    /**
     * 数据源
     */
    protected DataSource dataSource;

    /**
     * 指定数据源和SQL语句
     *
     * @param dataSource
     */
    public SqlQueryBuilder(DataSource dataSource) {
        this.dataSource = dataSource;
    }


    /**
     * 指定数据源和SQL语句
     */
    public SqlQuery build(SqlStatement sqlStatement) {
        return new SqlQueryImpl(dataSource, sqlStatement);
    }


    /**
     * 指定数据源和SQL语句
     */
    public SqlQuery build() {
        return build(null);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy