Class ADatabase
java.lang.Object
de.julianweinelt.datacat.dbx.database.ADatabase
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final recordstatic final record -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcommit()booleanconnect()Connect to the database using the default parameters of this database typebooleanconnect(ADatabase.ParameterBuilder builder) Connect to the database using custom parametersvoidvoidDisconnect from databaseextractTableMeta(String database, String table) abstract Stringabstract StringGet all database schemas on this database server.abstract ADatabase.SchemaInfogetSchemaInfo(String database) abstract ResultSetgetTableData(String database, String table) abstract Stringstatic ADatabaseprepareStatement(String sql) Prepare a statement for execution.voidrollback()abstract voidsetStreaming(boolean streaming) Set the database connecting to streaming mode.voiduseDatabase(String database) Execute theUSE [dbname];statement on the database connection.
-
Field Details
-
conn
-
-
Constructor Details
-
ADatabase
-
-
Method Details
-
of
-
internalName
-
connect
public boolean connect()Connect to the database using the default parameters of this database type- Returns:
trueif connection was successful, otherwisefalse
-
connect
Connect to the database using custom parameters- Parameters:
builder- AADatabase.ParameterBuilderobject containing all parameters- Returns:
trueif connection was successful, otherwisefalse
-
disconnect
public void disconnect()Disconnect from database -
setStreaming
public abstract void setStreaming(boolean streaming) Set the database connecting to streaming mode.- Parameters:
streaming- streaming mode
-
useDatabase
Execute theUSE [dbname];statement on the database connection.- Parameters:
database- The name of the database to use- Throws:
IllegalArgumentException- if the database name is invalidDatabaseSchemaNotFoundException- if the database doesn't exist
-
prepareStatement
Prepare a statement for execution.- Parameters:
sql- The SQL statement(s).- Returns:
- A
PreparedStatementfor use with escaping parameters - Throws:
SQLException- When something went wrong
-
getDatabases
Get all database schemas on this database server. -
getTables
-
getTableData
- Throws:
SQLException
-
getSchemaInfo
-
getDatabaseProductName
-
getDatabaseProductVersion
-
createDatabaseIfNotExists
-
extractTableMeta
- Throws:
SQLException
-
commit
public void commit() -
rollback
public void rollback()
-