skip to main content
Using the Driver : Connecting from an Application : Connecting Using the DriverManager : Passing the Connection URL
  

Try DataDirect Drivers Now
Passing the Connection URL
After setting the CLASSPATH, the required connection information needs to be passed in the form of a connection URL. The connection URL takes the form:
jdbc:datadirect:cassandra://server:port;
KeyspaceName=keyspace;[property=value[;...]]
where:
server
specifies the name or the IP address of the server to which you want to connect.
port
specifies the port of the server that is listening for connections to the Cassandra keyspace. The default is 9042.
keyspace
specifies the default name of the Cassandra keyspace to which the driver connects. This value is used as the default qualifier for unqualified table names in SQL queries. Note that a Cassandra keyspace is equivalent to a relational database.
property=value
specifies connection property settings. Multiple properties are separated by a semi-colon. For more information on connection properties, see Using Connection Properties.
This example shows how to establish a connection to a Cassandra data store:
Connection conn = DriverManager.getConnection
("jdbc:datadirect:cassandra://MyServer:9042;KeyspaceName=MyKS");