Class DatabaseService
- java.lang.Object
-
- org.openrefine.extension.database.DatabaseService
-
- Direct Known Subclasses:
MariaDBDatabaseService
,MySQLDatabaseService
,PgSQLDatabaseService
,SQLiteDatabaseService
public abstract class DatabaseService extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DatabaseService.DBType
-
Constructor Summary
Constructors Constructor Description DatabaseService()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
buildLimitQuery(Integer limit, Integer offset, String query)
abstract DatabaseInfo
connect(DatabaseConfiguration dbConfig)
abstract DatabaseInfo
executeQuery(DatabaseConfiguration dbConfig, String query)
static DatabaseService
get(String dbType)
get Databaseabstract List<DatabaseColumn>
getColumns(DatabaseConfiguration dbConfig, String query)
abstract Connection
getConnection(DatabaseConfiguration dbConfig)
protected String
getDatabaseUrl(DatabaseConfiguration dbConfig)
abstract List<DatabaseRow>
getRows(DatabaseConfiguration dbConfig, String query)
abstract boolean
testConnection(DatabaseConfiguration dbConfig)
abstract DatabaseInfo
testQuery(DatabaseConfiguration dbConfig, String query)
-
-
-
Method Detail
-
getDatabaseUrl
protected String getDatabaseUrl(DatabaseConfiguration dbConfig)
-
get
public static DatabaseService get(String dbType)
get Database- Parameters:
dbType
-- Returns:
-
getConnection
public abstract Connection getConnection(DatabaseConfiguration dbConfig) throws DatabaseServiceException
- Throws:
DatabaseServiceException
-
testConnection
public abstract boolean testConnection(DatabaseConfiguration dbConfig) throws DatabaseServiceException
- Throws:
DatabaseServiceException
-
connect
public abstract DatabaseInfo connect(DatabaseConfiguration dbConfig) throws DatabaseServiceException
- Throws:
DatabaseServiceException
-
executeQuery
public abstract DatabaseInfo executeQuery(DatabaseConfiguration dbConfig, String query) throws DatabaseServiceException
- Throws:
DatabaseServiceException
-
testQuery
public abstract DatabaseInfo testQuery(DatabaseConfiguration dbConfig, String query) throws DatabaseServiceException
- Throws:
DatabaseServiceException
-
getColumns
public abstract List<DatabaseColumn> getColumns(DatabaseConfiguration dbConfig, String query) throws DatabaseServiceException
- Throws:
DatabaseServiceException
-
getRows
public abstract List<DatabaseRow> getRows(DatabaseConfiguration dbConfig, String query) throws DatabaseServiceException
- Throws:
DatabaseServiceException
-
-