Configure an Apache™ Cassandra® database connection by creating a Cassandra data source, setting the Cassandra connection options, and saving the data source.
Create a Cassandra data source for a Cassandra database connection.
opts =
CassandraConnectionOptions with properties:
DataSourceName: ""
Vendor: "Cassandra"
ContactPoints: "localhost"
PortNumber: 9042
SSLEnabled: false
LoginTimeout: 5
RequestTimeout: 12
opts is an CassandraConnectionOptions object with these properties:
DataSourceName — Name of the data source
Vendor — Database vendor name
ContactPoints — Contact points
PortNumber — Port number
SSLEnabled — SSL-enabled connection
LoginTimeout — Login timeout
RequestTimeout — Request timeout
Configure the data source by setting the Cassandra connection options for the data source CassandraDataSource, local host address for one node in the cluster, port number 9042, SSL encryption that is disabled, login timeout of 5 seconds, and request timeout of 12 seconds.
opts =
CassandraConnectionOptions with properties:
DataSourceName: "CassandraDataSource"
Vendor: "Cassandra"
ContactPoints: "localhost"
PortNumber: 9042
SSLEnabled: false
LoginTimeout: 5
RequestTimeout: 12
The setoptions function sets the DataSourceName, ContactPoints, PortNumber, SSLEnabled, LoginTimeout, and RequestTimeout properties in the CassandraConnectionOptions object.
Test the database connection with a blank user name and password. The testConnection function returns the logical 1, which indicates the database connection is successful.
Save the configured data source.