Quick start with JDBC driver
-
Download the JDBC driver for YDB.
-
Copy the
.jarfile to the directory specified in theCLASSPATHenvironment variable or load the.jarfile in your IDE. -
Connect to YDB. JDBC URL examples:
- Local Docker container with anonymous authentication and without TLS:
jdbc:ydb:grpc://localhost:2136/local - Remote self-hosted cluster:
jdbc:ydb:grpcs://<host>:2135/Root/<testdb>?secureConnectionCertificate=file:~/<myca>.cer - A cloud database instance with a token:
jdbc:ydb:grpcs://<host>:2135/<path/to/database>?token=file:~/my_token - A cloud database instance with a service account:
jdbc:ydb:grpcs://<host>:2135/<path/to/database>?saFile=file:~/sa_key.json
- Local Docker container with anonymous authentication and without TLS:
-
Execute queries, for example, YdbDriverExampleTest.java.
Was the article helpful?
Previous
Next