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 data extract manual docid\ gh07 bsvqn9kqarjdm3la for a list of commands available in the jdbc cli, see commands supported by the ocient jdbc cli program docid 7uosju7ajx4yd61vqbhqu prerequisites 106,408,129 false true unhandled content type false unhandled content type unhandled content type false unhandled content type unhandled content type false unhandled content type unhandled content type false unhandled content type driver features the ocient jdbc connector supports these features as of the current version 152,510 false false false unhandled content type false unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type false unhandled content type false unhandled content type 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 maven repository for all jdbc versions for more information on which version to pick, see the version compatibility 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, download 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 false true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type for supported commands, see commands supported by the ocient jdbc cli program 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 secure connections using tls 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 supported jdbc classes and methods docid\ ifbc5timraamwgabpgmn4 related links connect using jdbc docid\ fpyaptctcu3mul0c66p8d data extract manual docid\ gh07 bsvqn9kqarjdm3la commands supported by the ocient jdbc cli program docid 7uosju7ajx4yd61vqbhqu supported jdbc classes and methods docid\ ifbc5timraamwgabpgmn4 {{linux}} is the registered trademark of linus torvalds in the u s and other countries