Package org.aoju.bus.shade.screw.dialect
Class AbstractDatabaseQuery
java.lang.Object
org.aoju.bus.shade.screw.dialect.AbstractDatabaseQuery
- All Implemented Interfaces:
DatabaseQuery
- Direct Known Subclasses:
CacheDbDataBaseQuery,Db2DataBaseQuery,H2DataBaseQuery,MariaDbDataBaseQuery,MySqlDataBaseQuery,OracleDataBaseQuery,OtherDataBaseQuery,PostgreSqlDataBaseQuery,SqlServerDataBaseQuery
抽象查询
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclose(Connection conn) 释放资源static void释放资源static voidclose(ResultSet rs, Connection conn) 释放资源static voidclose(ResultSet rs, Statement st, Connection conn) 释放资源protected String获取 getCatalogprotected DatabaseMetaData获取 DatabaseMetaDataList<? extends PrimaryKey>根据表名获取主键protected String获取 getSchemaprotected PreparedStatementprepareStatement(String sql) 准备声明Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.aoju.bus.shade.screw.dialect.DatabaseQuery
getDataBase, getPrimaryKeys, getTableColumns, getTableColumns, getTables
-
Field Details
-
columnsCaching
缓存 -
connection
Connection 双重锁,线程安全
-
-
Constructor Details
-
AbstractDatabaseQuery
-
-
Method Details
-
close
释放资源- Parameters:
rs-ResultSet
-
close
释放资源- Parameters:
conn-Connection
-
close
释放资源- Parameters:
rs-ResultSetconn-Connection
-
close
释放资源- Parameters:
rs-ResultSetst-Statementconn-Connection
-
getCatalog
获取 getCatalog- Returns:
String- Throws:
org.aoju.bus.core.exception.InstrumentException- 异常
-
getSchema
获取 getSchema- Returns:
String- Throws:
org.aoju.bus.core.exception.InstrumentException- 异常
-
getMetaData
获取 DatabaseMetaData- Returns:
DatabaseMetaData- Throws:
org.aoju.bus.core.exception.InstrumentException- 异常
-
prepareStatement
protected PreparedStatement prepareStatement(String sql) throws org.aoju.bus.core.exception.InstrumentException 准备声明- Parameters:
sql-StringSQL- Returns:
PreparedStatement- Throws:
org.aoju.bus.core.exception.InstrumentException- 异常
-
getPrimaryKeys
public List<? extends PrimaryKey> getPrimaryKeys() throws org.aoju.bus.core.exception.InstrumentException根据表名获取主键- Specified by:
getPrimaryKeysin interfaceDatabaseQuery- Returns:
List- Throws:
org.aoju.bus.core.exception.InstrumentException- 异常
-