Connect to Ocient
Connect Using JDBC
the jdbc driver can be executed in a command line interface (cli) mode or used directly in a program with standard jdbc methods this example describes how to connect using the cli mode for details on using the jdbc driver in code, please see establishing a connection step 1 download the jdbc driver first, confirm the recommended version of the jdbc driver for your version of {{ocient}} by finding it in version compatibility docid\ zp3jyidhcqu5kfidb4kpy download the correct jdbc driver from the {{maven}} repository by clicking on your preferred version, then selecting "view all" and finally downloading the jar file that is labeled with the pattern ocient jdbc4 \<version number> jar with dependencies jar save this file to a convenient location on your client machine step 2 run the jdbc cli program to run the jdbc cli program, you must have {{java}} installed on your machine for the version, see version compatibility docid\ zp3jyidhcqu5kfidb4kpy next, run the following command to start the jdbc cli program assuming your jar stored at /ocient jdbc4 jar with dependencies jar java classpath /ocient jdbc4 jar with dependencies jar com ocient cli cli the system prompts you to enter the username and password username test\@system password fakepassword example response ocient> the ocient cli prompt appears step 3 connect to connect, enter the connection string to your sql nodes sql nodes install by default with a self signed tls certificate for encryption by default, and a custom certificate can be present depending on the tls configuration, you can use tls=unverified (default) or tls=on for the required setting assuming the standard port 4050 , a self signed certificate, and the sql node ip address of 10 10 1 1 , you can connect to the system database with the following connecting string ocient> connect to jdbc\ ocient //10 10 1 1 4050/system; example response connected to jdbc\ ocient //10 10 1 1 4050/system ocient> you are now connected and can execute queries based on your user’s permissions try running select from sys tables; to see what tables are defined for more details on using the jdbc driver and the cli program, see the jdbc manual docid\ r3opknedllyoz4mxywjl2 the system cancels any queries made with the jdbc driver if you perform any of these actions fetch the entire result set close the connection execute a new query on the same connection related links connect to ocient docid\ lb5x4qrnpht6m9v2evhuc ocient integrations docid\ slds1ecb2mcriy 4z 6my