Connection Driver Reference
JDBC Manual
the {{ocient}} jdbc driver and command line interface (cli) enable you to connect to ocient using a jdbc connection ensure that you meet the prerequisites before using the ocient jdbc driver then, invoke the cli program, configure options, and connect to a database using the driver you can also use the data extract tool to extract a result set to delimited files in the target location for details about data extracting, see docid\ gh07 bsvqn9kqarjdm3la for a list of commands available in the jdbc cli, see docid 7uosju7ajx4yd61vqbhqu prerequisites software version ocient use the latest ocient system version os {{windows}} , {{linux}} , or {{macos}} use the latest version of each os system {{java}} see the docid\ xsitmbz5e4fada9cl6ohc driver features the ocient jdbc connector supports these features as of the current version unicode support utf 8 isolation levels ocient does not support transactions at this time data types supports all ocient docid\ ogtviwl gtbgv0chhrh 3 security / encryption uses ssl/tls to connect to the ocient system tls protocol is available as a /#jdbc cli configuration options invoke the ocient jdbc cli program if your system meets all the necessary prerequisites, you can run the jdbc cli by using the ocient jdbc jar file to do this, follow these steps go to the ocient https //mvnrepository com/artifact/com ocient/ocient jdbc4 for all jdbc versions for more information on which version to pick, see the docid\ xsitmbz5e4fada9cl6ohc page for the jdbc version you want to use, download the jar file with dependencies this jar file follows the format ocient jdbc4 \<version number> jar with dependencies jar move this jar file to the directory where your ocient system is installed from the shell terminal, run this command to launch the jdbc cli java classpath \<path to jar with dependencies> com ocient cli cli \[\<username> \[\<password>]] this example runs jdbc version 2 10 java classpath /ocient jdbc4 2 10 jar with dependencies jar com ocient cli cli testuser testpassword after launching, the jdbc cli prompts you to enter your username and password username admin\@system password admin the interface changes to the ocient cli ocient> connect to your system from the jdbc using a connection string assuming the standard port 4050 , a self signed certificate, and the sql node ip address 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; the cli responds with a connection message connected to jdbc\ ocient //10 10 1 1 4050/system ocient> now that you are connected to your system, you can execute any queries or commands for java version 1 8 0 144, https //www oracle com/java/technologies/javase jce8 downloads html and install the java cryptography extension (jce) unlimited strength jurisdiction policy files 8 jdbc cli configuration options the jdbc cli reads a configuration file consisting of key value pairs located at / ocient cli configuration with this format key1=value1 key2=value2 keyn=valuen this option is supported option comments default cliidletimeoutminutes configures the idle timeout for the cli the cli rejects subsequent commands and exits the process after cliidletimeoutminutes minutes of inactivity 0 if left unspecified or the configuration file does not exist printuuid accepts values on or off if you set the printuuid option to on , the system prints the query identifier for each query that you execute in the cli off for supported commands, see docid 7uosju7ajx4yd61vqbhqu use the ocient jdbc driver in java programs first, you must load the ocient driver class with this statement in a java program using the jdbc driver class forname("com ocient jdbc jdbcdriver"); the driver class is located in the jdbc driver jar file named ocient jdbc4 jar and must be available in the classpath defined for the program connection encryption (ssl/tls) the jdbc driver can use ssl/tls to connect to ocient, causing all traffic to be encrypted specify the tls property on the connect statement to enable tls support the tls property supports these values unverified traffic on the connection is encrypted, but no verification is done on the certificate received from the ocient system on traffic is encrypted, and the jdbc client must be able to verify the certificate received from the ocient system the tls on mode requires that the client knows the certificate authority that signed the certificate provided by the ocient system typically, this mode requires either that the certificate is signed by a well known certificate authority, or the certificate authority certificate has been imported into the truststore of the java system the java keytool utility is used to manipulate a java truststore docid\ ohgldjfash0zwpzwtsauq discusses how you can configure user defined certificates for the ocient system sample java program using the ocient jdbc driver this sample program illustrates how to use the ocient jdbc driver to connect to a database, build a prepared sql statement, execute the query, and loop through the result set public class ocientjdbcexample { public static void main(final string args\[]) { class forname("com ocient jdbc jdbcdriver"); properties props = new properties(); props setproperty("user", "username"); props setproperty("password", "pwd"); props setproperty("force", "true"); string url = "jdbc\ ocient //192 168 121 82 4050/db"; connection conn = drivermanager getconnection(url, props); preparedstatement pstmt = conn preparestatement( "select l orderkey from tpch lineitem where l linenumber = ?"); pstmt setint(1, 4); resultset rs = pstmt executequery(); while(rs next()){ // do something with row } rs close(); pstmt close(); conn close(); return; } } for supported classes and methods, see docid\ ifbc5timraamwgabpgmn4 related links docid\ fpyaptctcu3mul0c66p8d docid\ gh07 bsvqn9kqarjdm3la docid 7uosju7ajx4yd61vqbhqu docid\ ifbc5timraamwgabpgmn4 {{linux}} is the registered trademark of linus torvalds in the u s and other countries