[ 
https://issues.apache.org/jira/browse/CASSANDRA-2732?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13042791#comment-13042791
 ] 

Rick Shaw commented on CASSANDRA-2732:
--------------------------------------

A quick look at the code shows that its first step is to fin an "@" in the 
string and start the splitting based on that result. But it gets a -1 back and 
then tries to use that in substring... :(

So my quick first response is make the URL look more like the "successful" one 
with an "@" but dropping the UN/PW.

This seems to be a pretty fragile area. I have been asked by others to look at 
why the UN/PW does not seem to have any effect. So I expect there is more 
detailed work ahead.

> StringIndexOutOfBoundsException when specifying JDBC connection string 
> without user and password
> ------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2732
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2732
>             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(String.java:1937)
> [junit] at 
> org.apache.cassandra.cql.jdbc.CassandraConnection.<init>(CassandraConnection.java:74)
> [junit] at 
> org.apache.cassandra.cql.jdbc.CassandraConnection.<init>(CassandraConnection.java:74)
> [junit] at 
> org.apache.cassandra.cql.jdbc.CassandraDriver.connect(CassandraDriver.java:86)
> [junit] at java.sql.DriverManager.getConnection(DriverManager.java:582)
> [junit] at java.sql.DriverManager.getConnection(DriverManager.java:207)
> [junit] at 
> com.datastax.cql.runJDBCSmokeTest.setUpBeforeClass(runJDBCSmokeTest.java:45)
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to