Package mil.nga.geopackage.db
Class GeoPackageConnection
java.lang.Object
mil.nga.geopackage.db.GeoPackageCoreConnection
mil.nga.geopackage.db.GeoPackageConnection
- All Implemented Interfaces:
Closeable
,AutoCloseable
GeoPackage Android Connection wrapper
-
Field Summary
Fields inherited from class mil.nga.geopackage.db.GeoPackageCoreConnection
connectionSource
-
Constructor Summary
ConstructorDescriptionGeoPackageConnection
(GeoPackageConnection connection) Copy ConstructorGeoPackageConnection
(GeoPackageConnection connection, GeoPackageDatabase db) Copy ConstructorConstructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
close()
void
commit()
copy()
Copy methodCopy method with provided databaseint
void
endTransaction
(boolean successful) void
getDb()
Get the database connectionboolean
queryResults
(String sql, String[] args, GeoPackageDataType[] dataTypes, Integer limit) querySingleColumnResults
(String sql, String[] args, int column, GeoPackageDataType dataType, Integer limit) querySingleResult
(String sql, String[] args, int column, GeoPackageDataType dataType) Perform a raw database queryboolean
setUseBindings
(boolean useBindings) Set the active SQLite connection as the bindings or standardPerform the query and wrap as a resultMethods inherited from class mil.nga.geopackage.db.GeoPackageCoreConnection
addColumn, aggregateFunction, aggregateFunction, aggregateFunction, aggregateFunction, columnExists, count, count, count, count, count, count, enableForeignKeys, endAndBeginTransaction, endTransaction, failTransaction, foreignKeyCheck, foreignKeyCheck, foreignKeys, foreignKeys, getApplicationId, getApplicationId, getApplicationIdHex, getApplicationIdInteger, getUserVersion, getUserVersionMajor, getUserVersionMinor, getUserVersionPatch, max, max, min, min, queryResults, queryResults, queryResults, querySingleColumnResults, querySingleColumnResults, querySingleColumnResults, querySingleColumnResults, querySingleColumnResults, querySingleColumnTypedResults, querySingleColumnTypedResults, querySingleColumnTypedResults, querySingleColumnTypedResults, querySingleColumnTypedResults, querySingleColumnTypedResults, querySingleResult, querySingleResult, querySingleResult, querySingleRowResults, querySingleRowResults, querySingleRowTypedResults, querySingleRowTypedResults, querySingleTypedResult, querySingleTypedResult, querySingleTypedResult, querySingleTypedResult, queryTypedResults, queryTypedResults, queryTypedResults, queryTypedResults, setApplicationId, setApplicationId, setUserVersion, setUserVersion, tableExists, tableOrViewExists, viewExists
-
Constructor Details
-
GeoPackageConnection
Constructor- Parameters:
db
- GeoPackage connection
-
GeoPackageConnection
Copy Constructor- Parameters:
connection
- GeoPackage connection- Since:
- 3.4.0
-
GeoPackageConnection
Copy Constructor- Parameters:
connection
- GeoPackage connectiondb
- database- Since:
- 3.4.0
-
-
Method Details
-
copy
Copy method- Returns:
- connection
- Since:
- 3.4.0
-
copy
Copy method with provided database- Parameters:
db
- database- Returns:
- connection
- Since:
- 3.4.0
-
getDb
Get the database connection- Returns:
- GeoPackage database
-
setUseBindings
public boolean setUseBindings(boolean useBindings) Set the active SQLite connection as the bindings or standard- Parameters:
useBindings
- true to use bindings connection, false for standard- Returns:
- previous bindings value
- Since:
- 3.4.0
-
getConnectionSource
- Overrides:
getConnectionSource
in classGeoPackageCoreConnection
-
execSQL
- Specified by:
execSQL
in classGeoPackageCoreConnection
-
beginTransaction
public void beginTransaction()- Specified by:
beginTransaction
in classGeoPackageCoreConnection
-
endTransaction
public void endTransaction(boolean successful) - Specified by:
endTransaction
in classGeoPackageCoreConnection
-
commit
public void commit()- Specified by:
commit
in classGeoPackageCoreConnection
-
inTransaction
public boolean inTransaction()- Specified by:
inTransaction
in classGeoPackageCoreConnection
-
delete
- Specified by:
delete
in classGeoPackageCoreConnection
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classGeoPackageCoreConnection
-
querySingleResult
- Specified by:
querySingleResult
in classGeoPackageCoreConnection
-
querySingleColumnResults
public List<Object> querySingleColumnResults(String sql, String[] args, int column, GeoPackageDataType dataType, Integer limit) - Specified by:
querySingleColumnResults
in classGeoPackageCoreConnection
-
queryResults
public List<List<Object>> queryResults(String sql, String[] args, GeoPackageDataType[] dataTypes, Integer limit) - Specified by:
queryResults
in classGeoPackageCoreConnection
-
rawQuery
Perform a raw database query- Parameters:
sql
- sql commandargs
- arguments- Returns:
- cursor
- Since:
- 1.2.1
-
wrapQuery
Perform the query and wrap as a result- Parameters:
sql
- sql statementselectionArgs
- selection arguments- Returns:
- result
- Since:
- 3.1.0
-