类 AbstractDbHelper
- java.lang.Object
-
- com.xwl41.common.basic.helper.db.AbstractDbHelper
-
- 所有已实现的接口:
DbHelper
- 直接已知子类:
H2Helper,MySQLHelper
public abstract class AbstractDbHelper extends Object implements DbHelper
-
-
构造器概要
构造器 构造器 说明 AbstractDbHelper()
-
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected abstract DbConfigassembleDbConfig(String host, Integer port, String username, String password, String dbName)组装数据库配置类实例booleanexecute(String sqlStr)ResultSetexecuteQuery(String queryStr)intexecuteUpdate(String updateSqlStr)DbConfiggetConfig()ConnectiongetConnection()protected ConnectiongetConnection(String newUrl)ConnectiongetConnection(String url, String username, String password)DataSourcegetDataSource()获取数据源DataSourcegetDataSource(String newUrl)根据指定url获取数据源voidinit(DbConfig dbConfig)voidinit(String host, Integer port, String username, String password, String dbName)voidinit(String host, String username, String password, String dbName)voidsetConfig(DbConfig config)-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 com.xwl41.common.basic.helper.db.DbHelper
getTableColumns, getTableColumns, getTableColumns, getTableColumns
-
-
-
-
字段详细资料
-
config
protected DbConfig config
-
-
方法详细资料
-
getConnection
public Connection getConnection() throws SQLException
- 指定者:
getConnection在接口中DbHelper- 抛出:
SQLException
-
getConnection
protected Connection getConnection(String newUrl) throws SQLException
- 抛出:
SQLException
-
getConnection
public Connection getConnection(String url, String username, String password) throws SQLException
- 指定者:
getConnection在接口中DbHelper- 抛出:
SQLException
-
getDataSource
public DataSource getDataSource(String newUrl)
从接口复制的说明:DbHelper根据指定url获取数据源- 指定者:
getDataSource在接口中DbHelper- 参数:
newUrl- 数据库连接url- 返回:
- 数据源对象
-
getDataSource
public DataSource getDataSource()
从接口复制的说明:DbHelper获取数据源- 指定者:
getDataSource在接口中DbHelper- 返回:
- 数据源对象
-
executeQuery
public ResultSet executeQuery(String queryStr) throws SQLException
- 指定者:
executeQuery在接口中DbHelper- 抛出:
SQLException
-
execute
public boolean execute(String sqlStr) throws SQLException
- 指定者:
execute在接口中DbHelper- 抛出:
SQLException
-
executeUpdate
public int executeUpdate(String updateSqlStr) throws SQLException
- 指定者:
executeUpdate在接口中DbHelper- 抛出:
SQLException
-
-