Skip to content

Releases: DataStax-Examples/astra-jdbc-connector

5.1

19 Sep 13:42
Compare
Choose a tag to compare

Release note

  • Support for Vector in IDE as DBeaver or DataGrip
  • Update to latest astra-sdk

5.0

12 Jul 17:14
Compare
Choose a tag to compare
5.0

Create a JDBC Driver with limited number of parameters associated to Astra.

  • New Class com.datastax.astra.jdbc.AstraJdbcDriver
  • New Pattern associated with the class jdbc:astra//
  • Simplified URL jdbc:astra://<db>/<keyspace>?token=<token>

Using SQLConnection

String url = "jdbc:astra://myDatabase/keyspace1?token=AstraCS:<change_me>";
try (java.sql.Connection connection = java.sql.DriverManager.getConnection(url)) {
       PreparedStatement ps = connection.prepareStatement("select * from scientist limit 50;");
        java.sql.ResultSet rs = ps.executeQuery();
        while (rs.next()) {
            System.out.println(rs.getString("person_name") + " - " + rs.getInt("person_id"));
        }
} catch (java.sql.SQLException e) {
  System.out.println("[KO] " + e.getMessage());
}

Using SQL Datasource

AstraJdbcDataSource ds = new AstraJdbcDataSource("token", TOKEN, DB_ID, KEYSPACE);
try (java.sql.Connection connection = ds.getConnection()) {
   PreparedStatement ps = connection.prepareStatement("select * from scientist limit 50;");
        java.sql.ResultSet rs = ps.executeQuery();
        while (rs.next()) {
            System.out.println(rs.getString("person_name") + " - " + rs.getInt("person_id"));
        }
} catch (java.sql.SQLException e) {
  System.out.println("[KO] " + e.getMessage());
}

4.9.0

05 Jul 14:08
Compare
Choose a tag to compare

Build a Fat Jar for JDBC ING Wrapper

  • Upgrade to latest drivers version 4.16.0 for Vector Support
  • Single File for easy support in DataGrip and equivalent