I am connection to a Cassandra database with Java using the "BasicDataSource" class in the Apache Common DBCP library and using the DataStax driver "com.simba.cassandra.jdbc42.Driver". When Cassandra is configured with the "authenticator" set to "AllowAllAuthenticator", I can connection to the database. However when I enable "PasswordAuthenticator" and set the username/password in the "BasicDataSource" object, I cannot connect and get the exception "Authentication error on host /IP Address:Port: Host /IP Address:Port requires authentication, but no authenticator found in Cluster configuration.". What is needed to establish a secure connection ?
I have answered my own question. For anyone with the same problem, the solution is to include the option "AuthMech=1" in the JDBC connection string as it is needed for authenticated connections. The following is from the "Simba Cassandra JDBC Driver with SQL Connector" installation and configuration guide:
"AuthMech
This property specifies whether the driver connects to a Cassandra or Astra database, and whether the driver authenticates the connection.
Ref: https://docs.datastax.com/en/driver-matrix/doc/latestSimbaCassJDBCDriver.html (Page 31)