cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Shaw (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-2732) StringIndexOutOfBoundsException when specifying JDBC connection string without user and password
Date Wed, 15 Jun 2011 12:56:47 GMT


Rick Shaw commented on CASSANDRA-2732:

With the new changes a special cassandra properties file will not be necessary.

You may now use the properties argument in the DriverManager (or the username and password
arguments) it is also fully supported in the factory methods. It works with Datasources as

I agree that the URI is not the right place for user and password but it will continue to
be supported for convenience. The properties or the un/pw arguments to the Drivermanager will
alway take precedence.

Any additional helpful parameters to give hints to the driver are supposed to be passed in
this fashion. There just are not any that are supported yet. When we support built in pooling
(external pooling of connection works now) those arguments you spoke of will be passed in
the properties argument as well.

The goal is this should look and feel like any other JDBC driver for a DB with the few limitations
that are unique to C*.

> StringIndexOutOfBoundsException when specifying JDBC connection string without user and
> ------------------------------------------------------------------------------------------------
>                 Key: CASSANDRA-2732
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 0.8 beta 1
>            Reporter: Cathy Daw
>            Assignee: Rick Shaw
>            Priority: Trivial
>              Labels: cql
> *PASS: specify connection string user and password*
> _connection = DriverManager.getConnection("jdbc:cassandra:root/root@localhost:9170/default")_
> *FAIL: specify connection string without user and password*
> _connection = DriverManager.getConnection("jdbc:cassandra://localhost:9170/default")_
> {code}
> [junit] String index out of range: -1
> [junit] java.lang.StringIndexOutOfBoundsException: String index out of range: -1
> [junit] at java.lang.String.substring(
> [junit] at org.apache.cassandra.cql.jdbc.CassandraConnection.<init>(
> [junit] at org.apache.cassandra.cql.jdbc.CassandraConnection.<init>(
> [junit] at org.apache.cassandra.cql.jdbc.CassandraDriver.connect(
> [junit] at java.sql.DriverManager.getConnection(
> [junit] at java.sql.DriverManager.getConnection(
> [junit] at com.datastax.cql.runJDBCSmokeTest.setUpBeforeClass(
> {code}

This message is automatically generated by JIRA.
For more information on JIRA, see:


View raw message