java.lang.Object | |
↳ | com.carto.services.CartoSQLService |
A high-level interface for Carto SQL Service.
The service can be used to query data from Carto databases
using explicit SQL queries.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CartoSQLService()
Constructs a new CartoSQLService service instance with default settings.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
synchronized void | delete() | ||||||||||
boolean |
equals(Object obj)
Checks if this object is equal to the specified object.
| ||||||||||
String |
getAPIKey()
Returns the API key used when accessing the online service.
| ||||||||||
String |
getAPITemplate()
Returns the API endpoint template of the online service.
| ||||||||||
String |
getUsername()
Returns the user account name used when accessing the online service.
| ||||||||||
int |
hashCode()
Returns the hash value of this object.
| ||||||||||
Variant |
queryData(String sql)
Connects to the online service and performs the specified query,
The resulting JSON is deserialized into a Variant that is returned. | ||||||||||
FeatureCollection |
queryFeatures(String sql, Projection proj)
Connects to the online service and performs the specified query.
| ||||||||||
void |
setAPIKey(String apiKey)
Sets the optional API key used when accessing the online service.
| ||||||||||
void |
setAPITemplate(String apiTemplate)
Sets the API endpoint template of the online service.
| ||||||||||
void |
setUsername(String username)
Sets the user account name used when accessing the online service.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Constructs a new CartoSQLService service instance with default settings.
Checks if this object is equal to the specified object.
obj | The reference object. |
---|
Returns the API key used when accessing the online service.
Returns the API endpoint template of the online service.
Returns the user account name used when accessing the online service.
Returns the hash value of this object.
Connects to the online service and performs the specified query,
The resulting JSON is deserialized into a Variant that is returned.
sql | The SQL query to use. |
---|
Exception | If IO error occured during the operation. |
---|---|
IOException |
Connects to the online service and performs the specified query.
The resulting JSON is deserialized into a FeatureCollection that is returned.
sql | The SQL query to use. |
---|---|
proj | The projection to use for transforming feature coordinates. Can be null for WGS84 coordinates. |
Exception | If IO error occured during the operation. |
---|---|
IOException |
Sets the optional API key used when accessing the online service.
Usually this is not needed and can be left blank.
apiKey | The optional API key used when accessing the online service. |
---|
Sets the API endpoint template of the online service.
By default cartodb.com endpoint is used. This needs to be redefined only for on-premise services.
apiTemplate | The API endpoint template of the online service. For example, "https://{user}.cartodb.com" |
---|
Sets the user account name used when accessing the online service.
username | The user account name used when accessing the online service. |
---|