public class SpatiaLiteDbConnector extends java.lang.Object implements DbConnector
Modifier and Type | Field and Description |
---|---|
private java.sql.Connection |
connection |
private java.lang.String |
dbName |
private java.lang.String |
encoding |
Constructor and Description |
---|
SpatiaLiteDbConnector(java.lang.String dbName,
java.lang.String encoding)
Constructor of DbConnector implementation class for establishing connection to a SpatiaLite database.
|
Modifier and Type | Method and Description |
---|---|
void |
closeConnection()
Closes the connection to the database.
|
java.sql.ResultSet |
executeQuery(java.lang.String query)
Returns the result of the SQL query executed against the SpatiaLite database.
|
java.lang.String |
getDatabaseUrl()
Returns the Database URL.
|
private java.sql.Connection |
openConnection()
Establishes a connection to the Database.
|
private java.lang.String dbName
private java.sql.Connection connection
private java.lang.String encoding
public SpatiaLiteDbConnector(java.lang.String dbName, java.lang.String encoding)
dbName
- The name of the database.encoding
- The character encoding used in the database.public java.lang.String getDatabaseUrl()
getDatabaseUrl
in interface DbConnector
public java.sql.ResultSet executeQuery(java.lang.String query)
executeQuery
in interface DbConnector
query
- A SQL command for the SELECT query.public void closeConnection()
closeConnection
in interface DbConnector
private java.sql.Connection openConnection()