Coder Social home page Coder Social logo

sk185050 / cassandra-jdbc-driver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wise-coders/cassandra-jdbc-driver

0.0 0.0 0.0 17.57 MB

Cassandra JDBC Driver | DbSchema Cassandra Designer

Home Page: https://dbschema.com/database-designer/Cassandra.html

License: Apache License 2.0

Java 100.00%

cassandra-jdbc-driver's Introduction

Cassandra JDBC Driver | DbSchema Cassandra Designer

This is an open source JDBC Driver for Cassandra. The driver is provided and used by DbSchema Cassandra GUI Tool. The code is using few improvements done to the original code by DataGrip.

Licensing

GPL-3 dual license. The driver is free to use by everyone. Code modifications allowed only to the current repository as pull requests https://github.com/wise-coders/cassandra-jdbc-driver

Features

  • Connect to Cassandra using the same JDBC URL as the native Cassandra Java driver
  • Execute native Cql queries
  • Implement of DatabaseMetaData methods for getting table, columns and index structure

Downloading the Driver Binaries

Available here. Unpack and include all jars in your classpath.

How to Configure the JDBC Driver

  • Java Driver Class: CassandraJdbcDriver
  • JDBC URL: jdbc:cassandra://host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[keyspace];dataCenter[&options]]
  • Website: DbSchema

Make sure your password don't have any ampersand character (&), since it is part of the parameters' delimiter. If it is not possible, set your password by using a Properties object.

Find the DataCenter using 'nodetool status' or 'nodetool -h ::FFFF:127.0.0.1 status'.

The driver we wrote on top of the native Cassandra Java Driver

Using a File to Configure Your Driver

You can configure your driver using a file by passing using the configfile parameter and the path to file, like this:

configfile=/path/to/file.conf

Please, refer to DataStax Driver Configuration Reference to know all possible parameters.

Connecting using SSL

For this set this URL parameters:

javax.net.ssl.trustStore=/path/to/client.truststore&javax.net.ssl.trustStorePassword=password123&

If you're using client authentication:

javax.net.ssl.keyStore=/path/to/client.keystore&javax.net.ssl.keyStorePassword=password123

This parameters can be also set in DbSchema.vmoptions file like :

-Djavax.net.ssl.trustStore=/path/to/client.truststore

-Djavax.net.ssl.trustStorePassword=password123

If you're using client authentication:

-Djavax.net.ssl.keyStore=/path/to/client.keystore

-Djavax.net.ssl.keyStorePassword=password123

Retrieving your Password from an AWS Secrets Entry

You can to retrieve your password from AWS Secrets by passing these parameters:

  • awsregion: The region which your secret was stored in;

  • awssecretname: The name of the secret were is your password stored in.

  • awssecretkey: The key of the secret used to get a password from your secret.

To authenticate in AWS, the driver uses the DefaultCredentialsProviderChain. To know more about it, refer to AWS DefaultCredentialsProvider documentation.

Connecting to AWS Keyspaces

You can connect to AWS Keyspaces by using this JDBC URI example:

jdbc:cassandra://<aws_keyspaces_endpoint>:9142/<default_keyspaces>?dc=<aws_region>&javax.net.ssl.trustStore=/path/to/client.truststore&javax.net.ssl.trustStorePassword=password123

Click here to know more about AWS Keyspaces Service Endpoints.

How to Test the Driver

The driver can be tested by simply by downloading DbSchema. The tool can be evaluated 15 days for free.

DbSchema already include the Cassandra JDBC driver. You can simply connect to Cassandra and reverse engineer the schema.

Connect DbSchema to Cassandra

Using the second tab you can enter a custom URL.

Connect DbSchema to Cassandra using Custom URI

DbSchema can reverse engineer the schema and represent it as diagrams.

Cassandra database diagrams

The Query Editor can be used for executing Cql Queries:

Cassandra Query Editor

DbSchema can create virtual foreign keys, which are saved to project file. They can be used in Relational Data Browse, to simply explore data from multiple tables.

Relational Data Browse for Cassandra

Also a random data generator for Cassandra is available:

Cassandra Random Data Generator

cassandra-jdbc-driver's People

Contributors

dprutean avatar kornilova203 avatar limadantas avatar michaelburris avatar wise-coders avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.