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
public class GeoPackageConnection extends GeoPackageCoreConnection
GeoPackage Connection wrapper- Author:
- osbornb
-
-
Field Summary
-
Fields inherited from class mil.nga.geopackage.db.GeoPackageCoreConnection
connectionSource
-
-
Constructor Summary
Constructors Constructor Description GeoPackageConnection(File file, Connection connection, ConnectionSource connectionSource)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beginTransaction()
void
close()
void
commit()
int
delete(String table, String whereClause, String[] whereArgs)
void
endTransaction(boolean successful)
void
execSQL(String sql)
Connection
getConnection()
Get the connectionConnectionSource
getConnectionSource()
boolean
inTransaction()
ResultSet
query(String sql, String[] args)
Perform a database queryList<List<Object>>
queryResults(String sql, String[] args, GeoPackageDataType[] dataTypes, Integer limit)
List<Object>
querySingleColumnResults(String sql, String[] args, int column, GeoPackageDataType dataType, Integer limit)
Object
querySingleResult(String sql, String[] args, int column, GeoPackageDataType dataType)
String
readableSize()
Get a readable version of the database sizelong
size()
Size of the database in bytes-
Methods 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 Detail
-
GeoPackageConnection
public GeoPackageConnection(File file, Connection connection, ConnectionSource connectionSource)
Constructor- Parameters:
file
- fileconnection
- connectionconnectionSource
- connection source
-
-
Method Detail
-
getConnection
public Connection getConnection()
Get the connection- Returns:
- connection
-
getConnectionSource
public ConnectionSource getConnectionSource()
- Overrides:
getConnectionSource
in classGeoPackageCoreConnection
-
size
public long size()
Size of the database in bytes- Returns:
- bytes
- Since:
- 4.0.0
-
readableSize
public String readableSize()
Get a readable version of the database size- Returns:
- size
- Since:
- 4.0.0
-
execSQL
public void execSQL(String sql)
- 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
public int delete(String table, String whereClause, String[] whereArgs)
- Specified by:
delete
in classGeoPackageCoreConnection
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classGeoPackageCoreConnection
-
querySingleResult
public Object querySingleResult(String sql, String[] args, int column, GeoPackageDataType dataType)
- 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
-
-