funcool / funcool/clojure.jdbc

Various Derby URLs fail in core.jdbc/connection

Offen
#32 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
bug
Vorherrschende Sprache
Clojure
Sterne
106
Forks
23
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

e.g.

user=> (with-open [conn (jdbc/connection "derby:/path/to/db;user=dot;password=D^1@?pw*qwK")] (jdbc/execute conn "insert into foo values ('hello')"))
URISyntaxException Illegal character in path at index 37: derby:/path/to/db;user=dot;password=D^9@?pw*qwK java.net.URI$Parser.fail (URI.java:2848)

user=> (with-open [conn (jdbc/connection "derby:memory:derby2pg;create=true")] "create table foo(bar varchar(10))")
SQLException No suitable driver found for jdbc:derby:// java.sql.DriverManager.getConnection (DriverManager.java:689)

Both of these urls work fine e.g.

user=> (with-open [conn (DriverManager/getConnection "jdbc:derby:/path/to/db;user=dot;password=D^9@?pw*qwK")] )
nil

user=> (with-open [conn (DriverManager/getConnection "jdbc:derby:memory:foobacle;create=true")] )
nil

In the first case, it looks like the code that attempts to make the connection is passing the string to java's URI class and fails because of some character in the password. This isn't that big of a deal for me to work around, because I can create the connections with DriverManager and just pass them on to the library. However, it seems like rather than forcing users of the library to do that, the library should not try to build a URI out of the raw string and simply create the connection based on the raw string.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.