Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

venkatamedagam avatar image
venkatamedagam asked ·

What are the alternative Java driver 3.6.0 APIs for migrating to 4.x?

Hi Team, We are migrating the project from IBMJDK1.8 to OpenJDK11 with Karaf 4.2.10 and Datastax from 3.6.0 to 4.0.0 or above.

my question is :

what are the alternatives for the below mentioned APIs which are from 3.6.0 to 4.0.0 or to 4.2.1(com.datastax.oss.driver). We are struggling to find the the alternatives for below mentioned APIs:

import com.datastax.driver.core.Session;
import com.datastax.driver.core.UserType;
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.HostDistance;
import com.datastax.driver.core.JdkSSLOptions;
import com.datastax.driver.core.KeyspaceMetadata;
import com.datastax.driver.core.PoolingOptions;
import com.datastax.driver.core.ProtocolVersion;
import com.datastax.driver.core.SSLOptions;
import com.datastax.driver.core.Session;
import com.datastax.driver.core.UserType;
import com.datastax.driver.core.policies.DCAwareRoundRobinPolicy;
import com.datastax.driver.core.RegularStatement;
import com.datastax.driver.core.querybuilder.QueryBuilder;

Could you please help on this?

java driver
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

The Java driver was redesigned in version 4 so it is not binary-compatible with older versions. You will need to rewrite your application to use the new APIs.

For example, Cluster does not exist anymore and was replaced with CqlSession. See the Java driver Upgrade Guide for details.

In addition, we advise against upgrading to old versions of the driver. Instead, we recommend you upgrade to the latest version which at the time of writing is Java driver v4.9. Cheers!


Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.