in Education by
The error ; Execution error (SunCertPathBuilderException) at sun.security.provider.certpath.SunCertPathBuilder/build (SunCertPathBuilder.java:141). ; unable to find valid certification path to requested target The code (Clojure) (ns backend.core (:require [next.jdbc :as jdbc])) (defn -main "I don't do a whole lot ... yet." [& args] (println "Hello, World!")) (def db {:dbtype "sqlserver" :dbname "dbname" :user "MY_USER" :password "MY_PASSWORD" :host "MY_HOST" :port 1234}) (def datasource (jdbc/get-datasource db)) (defn create-product "Create a product." [name ds] (jdbc/execute! ds [(str "insert into dbo.product (name) value('" name "')")])) (comment (create-product "my-product" datasource)) I'm playing around with clojure/sql server/next.jdbc and trying to work with my distant SQL Server 2017, but this error appear... It look like I need some certificate. Is it the case? How can I generate it? How can I install it on my dev PC? Should it be install in a specific place? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I fixed my issue by changing the content of the (def db ...). Here is the updated code working. (ns backend.core (:require [next.jdbc :as jdbc])) (defn -main "I don't do a whole lot ... yet." [& args] (println "Hello, World!")) (def db {:jdbcUrl "jdbc:sqlserver://MY_DISTANT_HOST:12345;databaseName=DB_NAME;user=USERNAME;password=MY_PASSWORD;encrypt=true;trustServerCertificate=true"}) (def datasource (jdbc/get-datasource db)) (defn create-product "Create a product." [name ds] (with-open [connection (jdbc/get-connection ds)] (jdbc/execute! connection ["insert into dbo.product (name) values (?)" name] {:return-keys true}))) (comment (create-product "my-product" datasource)) You can find more information about jdbc connection string here: https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15 I too ran into a second issue after updating the data-source configuration. The error was: no mssql-jdbc_auth-8.2.1.x64 in java.library.path I only needed to download zip file here https://docs.microsoft.com/en-us/sql/connect/jdbc/download-microsoft-jdbc-driver-for-sql-server?view=sql-server-ver15, unzip it and follow instructions inside install.txt and finally restart my IDE (VS Code).

Related questions

0 votes
0 votes
    I have been trying to connect to my prod server from my dev using connect to remote (which gets ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 8, 2022 in Education by JackTerrance
0 votes
    Using gxt and maven. I can get my project to compile and build a war file. But every time I try ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 13, 2022 in Education by JackTerrance
0 votes
    Seven persons are to be seated in a row. Find the probability that 2 particular persons sit next to each other. Select the correct answer from above options...
asked Nov 25, 2021 in Education by JackTerrance
0 votes
    Find the next number in follow sequence 111 13 112 24 113 35 117 ? A) 46 B) 57 C) 68 D) 79...
asked Feb 13, 2021 in Education by JackTerrance
0 votes
    Using the readlink function used as a solution to How do I find the location of the executable in C ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
0 votes
    In which search problem, to find the shortest path, each city must be visited once only? Map coloring ... path between a source and a destination Travelling Salesman problem...
asked Mar 8, 2021 in Technology by JackTerrance
0 votes
    As far as I've experienced JPA/hibernate will return entities that either exists at the database or have ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 18, 2022 in Education by JackTerrance
0 votes
    I'm trying to fetch some data from the REST API of HP Alm. It works pretty well with a small ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    I have created a docker image. I want to push it into my docker repo but I am facing this error: denied: ... to the resource is denied Select the correct answer from above options...
asked Jan 21, 2022 in Education by JackTerrance
0 votes
    MAHESH FOUND IT VERY DIFFICULT TO COPY FILES ON DOS AND REQUESTED HIS BOSS TO GET WINDOWS LOADED ON HIS SYSTEM. GIVE THE REASON WHY Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    Caching Technique where cache is populated the first time a certain piece of data is requested is called _________. (a)Local ... (b)Lazy Loading (c)Cache aside (d)Upfront Loading...
asked Oct 6, 2020 in Technology by JackTerrance
0 votes
    Which of the following in a cache address, specifies the exact location in the cache line where the requested data exists? (a)Block Number (b)Block Offset (c)Block Index (d)Tag...
asked Oct 6, 2020 in Technology by JackTerrance
0 votes
    Ved hits the target 7 times out of 10 shots. Find his probability of missing the target. Select the correct answer from above options...
asked Nov 25, 2021 in Education by JackTerrance
...