This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-21
Channels
- # announcements (7)
- # babashka (16)
- # beginners (174)
- # biff (7)
- # calva (20)
- # cider (3)
- # clerk (6)
- # cljsrn (4)
- # clojure (98)
- # clojure-europe (57)
- # clojure-italy (3)
- # clojure-nl (1)
- # clojure-portugal (1)
- # clojure-spec (15)
- # clojure-uk (7)
- # code-reviews (3)
- # cursive (23)
- # data-science (1)
- # datomic (26)
- # dev-tooling (2)
- # emacs (5)
- # figwheel-main (4)
- # fulcro (3)
- # honeysql (20)
- # hyperfiddle (20)
- # malli (8)
- # membrane (31)
- # nextjournal (5)
- # pathom (1)
- # polylith (20)
- # re-frame (14)
- # reitit (8)
- # releases (2)
- # shadow-cljs (50)
- # specter (2)
- # sql (22)
- # xtdb (5)
Hey guys, I' trying to connect to a db, but I'm getting a java.sql.SQLInvalidAuthorizationSpecException
I have a connection to this db via Datagrip but I can't figure out what I'm missing for next.jdbc to etablish the connectio. This is my code:
(def db
{:dbtype "mariadb"
:dbname "te***te"
:host "*****"
:user "lukas.o*******r"
:password "*************"
:port 4002
:enabledTLSProtocols "TLSv1,TLSv1.1,TLSv1.2,TLSv1.3" ;; also set in datagrip
})
(def ds (jdbc/get-datasource db))
(jdbc/execute! ds ["select * from customer where Name like '%lukas%';"])
Perhaps a long shot, but I notice that your database in datagrip is telemate
(8 characters), but your c&p to here for dbname
is te***te
which I assume is also telemate
, yet it's only 7 characters. Perhaps just a typo in your c&p, right?
Just to check: you're running the Clojure code on the same machinery that you are successfully running DataGrip to connect?
It's possible you may need to add :useSSL true
to your db
hash map (different drivers default to SSL vs non-SSL). You may also need :trustServerCertificate true
but only add that if you need it as well since it reduces security.
but I get this error now
Caused by sun.security.provider.certpath.SunCertPathBuilderException
unable to find valid certification path to requested target
Sometimes the stacktrace provides a Cause which offers more detail about why you get InvalidAuthorization (but whatever editor you're using hid that information).
CIDER trying to be... "helpful"... 😕