com.cudrania.jdbc.query.SqlQueryBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cudrania Show documentation
Show all versions of cudrania Show documentation
support tools for java development
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);
}
}