krummas / DrizzleJDBC

A BSD licensed JDBC driver for Drizzle and MySQL
BSD 3-Clause "New" or "Revised" License
31 stars 22 forks source link

Fixed #10 - IPv6 addresses are now accepted as part of URL #11

Closed misambart closed 11 years ago

misambart commented 11 years ago

I have recently started testing Drizzle-JDBC using IPv6 addresses and this results in an exception in the parse(String url) method of org.drizzle.jdbc.JDBCUrl. This is caused by the fact that IPv6 addresses contain ":" characters.

I have prepared and tested a fix for this issue. I finally got the time to publish the patch on github.

The code change allows IPv6 addresses when placed between square brackets (this matches general URL formatting standards for IPv6 addresses): jdbc:drizzle://[IPv6Address]:3306/database_name

For example, with the IPv6 localhost address, this would look like this: jdbc:drizzle://[::1]:3306/database_name