{"id":2328,"date":"2021-08-23T09:00:09","date_gmt":"2021-08-23T00:00:09","guid":{"rendered":"https:\/\/jennifersoft.com\/en\/uncategorized\/sql%eb%a1%9c-%ec%a0%9c%eb%8b%88%ed%8d%bc-%eb%8d%b0%ec%9d%b4%ed%84%b0-%ec%a1%b0%ed%9a%8c%ed%95%98%ea%b8%b0\/"},"modified":"2021-08-23T13:54:13","modified_gmt":"2021-08-23T04:54:13","slug":"2021-08-23","status":"publish","type":"post","link":"https:\/\/jennifersoft.com\/en\/blog\/tech\/2021-08-23\/","title":{"rendered":"Viewing Jennifer data with SQL"},"content":{"rendered":"\n<figure class=\"wp-block-image wide\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/05\/sql_main-1-1024x715.jpg\" alt=\"\" class=\"wp-image-9160\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Using the Jennifer API server<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Jennifer\nsaves the data collected per second in its own file system.<br>\nThe file system is developed to process large size data at high speed, and\ncustomer companies are collecting and processing large instance data in a\nstable manner. But since the file system is developed on their own, it has some\ndifficulties in viewing the data in form that a user wants to view.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So, a lot of customers gave us feedbacks that they want to view and use Jennifer data with SQL more freely and the R&amp;D team of  Jennifer has been working hard to learn how to improve them and adding new functions as a result.  <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">At present, Jennifer provides two types of SQL viewing methods. In this article, I will show you how to view data by using the Jennifer API server and JDBC driver.<br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The\nJennifer API server operates as an independent process from the Jennifer\nserver. &nbsp;<br>\nThe JDBC driver sends a request received from a user to the API server that\nreads the file DB and sends the HTTP responses as results.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"918\" height=\"175\" src=\"https:\/\/jennifersoft.com\/en\/wp-content\/uploads\/sites\/3\/2021\/07\/Group-16.jpg\" alt=\"\" class=\"wp-image-2455\" srcset=\"https:\/\/jennifersoft.com\/en\/wp-content\/uploads\/sites\/3\/2021\/07\/Group-16.jpg 918w, https:\/\/jennifersoft.com\/en\/wp-content\/uploads\/sites\/3\/2021\/07\/Group-16-300x57.jpg 300w\" sizes=\"auto, (max-width: 918px) 100vw, 918px\" \/><figcaption>Jennifer API Server Architecture<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Before you can use the Jennifer API, you must check whether the following files exist in the downloaded package.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Each package is downloadable from the following link.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">API Server : <a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/github.com\/jennifersoft\/jennifer5-api-server\">https:\/\/github.com\/jennifersoft\/jennifer5-api-server<\/a> <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">JDBC Driver :  <a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/github.com\/jennifersoft\/jennifer5-jdbc-driver\">https:\/\/github.com\/jennifersoft\/jennifer5-jdbc-driver<\/a> <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"> Jennifer API server configuration file is called conf\/api_server.conf and it is prepared in the yaml format.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">apiServer:\n   host: \"0.0.0.0\"\n   port: 8080               JENNIFER API server's port number\n   authentication:\n     id: \"jennifer\"          Access ID\n     password: \"jennifer\"      Access password <\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">jennifer:\n   dataServer:               Data server data \n     db:\n       - {path: \"\/home\/jennifer\/server.data\/db_data\", name: \"default\"} dbName\n   viewServer:               View server data\n     db:\n\n{path: \"\/home\/jennifer\/jennifer5-server\/db_view\", name: \"default\"}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; &nbsp;If you want to view the file DB data of multiple data servers or view servers, then add the directory paths as follows. <\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">db:\n  - {path: \"\/home\/jennifer\/server.data\/db_data\", name: \"default\"}\n  - {path: \"\/home\/jennifer\/server.data\/db_data1\", name: \"data1\"}\n  - {path: \"\/home\/jennifer\/server.data\/db_data2\", name: \"data2\"}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, let\u2019s learn how to use the Jennifer API server in an easy way.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, unzip the jennifer-api-server-{version}.zip file, and then edit the path of the view server or data server in the conf\/api_server.conf file to match the path of the user&#8217;s JENNIFER DB.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you run the bin\/api-server (or api-server.bat) file, you can see the following log.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/05\/api_start-1024x332.png\" alt=\"\" class=\"wp-image-8722\"\/><figcaption>Example) JENNIFER API server execution<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"> Now, the Jennifer API server is executed, we can view the data <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Since it is manufactured with the standard JDBC, we can use it in almost all the DB tools. In this article, we will learn how to use the built-in CLI of the driver, develop additional applications and use DBeaver which is an open-source DB management tool.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First,\nthis is how to access by using the CLI function provided by the Jennifer JDBC\ndriver.<br>\nAs shown in the following, once you run the Jennifer JDBC driver, you can\neasily access the Jennifer DB.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/05\/image-1024x305.png\" alt=\"\" class=\"wp-image-8707\"\/><figcaption>Example) Running the CLI environment by using JENNIFER JDBC Driver<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Using the\nSQL statement while the CLI is running, you can view the Jennifer data.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/05\/image-3-1024x269.png\" alt=\"\" class=\"wp-image-8708\"\/><figcaption>Example) Viewing the JENNIFER transaction table list in the CLI environment<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to implement an additional function by managing or viewing the Jennifer DB, you can use DriverManager to view data as follows.  <\/p>\n\n\n\n<hr class=\"\" style=\"\n    width: 100%;\n    max-width: 765px;\n    border: 1px solid #e8e8e8 !important;\n\">\n\n\n\n<h4 class=\"wp-block-heading\">\/\/HTTP can be omitted<\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>DriverManager.getConnection(&#8220;jdbc:jennifer:\/\/host:port&#8221;)<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>\/\/ In case of port 80 <\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>DriverManager.getConnection(&#8220;jdbc:jennifer:\/\/host&#8221;)<\/li><li>DriverManager.getConnection(&#8220;jdbc:jennifer:http:\/\/host:port&#8221;)<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>\/\/ If dbName is&nbsp;distinguished<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>DriverManager.getConnection(&#8220;jdbc:jennifer:http:\/\/host:port;dbName=jennifer&#8221;)<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>\/\/ When viewing View Server DB <\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>DriverManager.getConnection(&#8220;jdbc:jennifer:http:\/\/host:port;dbType=view;dbName=jennifer&#8221;)<\/li><\/ul>\n\n\n\n<hr class=\"\" style=\"\n    width: 100%;\n    max-width: 765px;\n    border: 1px solid #e8e8e8 !important;\n    margin-top:40px;\n\">\n\n\n\n<p class=\"wp-block-paragraph\">Next, we will show you how to use the SQL client.<br> Although there are many different tools, we will use the most widely used open-source called DBeaver for demonstration purposes. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1. .Move the Jennifer JDBC driver to the Driver Manager menu and register it. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/05\/1.5-add-library-1024x580.png\" alt=\"\" class=\"wp-image-8709\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">2.  Enter the following information for access: Class Name, Host, Port <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/05\/1.create-new-driver-1024x582.png\" alt=\"\" class=\"wp-image-8710\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">3.  In the property tab, register dbType, dbName for access. It is matched to the definition of dbPath added in the API server setting and you can ski this if the single DB path is designated. In this case, dbPath called \u201cdefault\u201d will be selected.   <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/05\/2.edit-properties-1024x583.png\" alt=\"\" class=\"wp-image-8711\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">4.  In the new DB connection menu, search for the Jennifer5 driver and make a selection. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/05\/3.connect-to-database-1024x583.png\" alt=\"\" class=\"wp-image-8712\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">5.  Enter the necessary information for access. When you enter the ID\/Password, use the one in authenticate area of the AIP server configuration file. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/05\/4.connection-setting-1024x583.png\" alt=\"\" class=\"wp-image-8713\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">6.  Select the new SQL editor. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/05\/5.new-sql-script-1024x584.png\" alt=\"\" class=\"wp-image-8714\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">7. Using the SQL (select * from all_tables) prepared ahead of time, you can check the list of tables that you can view. Of course, you can select a schema name to check the information.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/05\/6.table-list-search-1024x582.png\" alt=\"\" class=\"wp-image-8715\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">8.  You can run SQL that you want for the table that is confirmed. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jennifersoft.com\/ko\/wp-content\/uploads\/sites\/2\/2021\/05\/7.query-table-1024x582.png\" alt=\"\" class=\"wp-image-8716\"\/><figcaption>Example) You can prepare SQL for the desired table and run it on your own. <br>Example of transaction data viewing) select * from transaction_1004_20210401;<br><br><\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You can view the following types of tables now.<\/p>\n\n\n\n<div class=\"article-contents-width\">\n<table style=\"width:100%;border-radius:5px;padding:24px;background-color:#F8F9FA;\"><tbody><tr>\n<td style=\"color:#9245db;\">\u2714<\/td>\n<td style=\"line-height:40px;font-weight:bold;\"> APPLICATION_STATISTIC_domain_date<\/td>\n<\/tr>\n<tr>\n<td style=\"color:#9245db;\">\u2714<\/td>\n<td style=\"line-height:40px;font-weight:bold;\">TRANSACTION_doamin_date\n<\/td>\n<\/tr>\n<tr>\n<td style=\"color:#9245db;\">\u2714<\/td>\n<td style=\"line-height:40px;font-weight:bold;\">INSTANCE_METRIC_domain_date<\/td>\n<\/tr>\n<tr>\n<td style=\"color:#9245db;\">\u2714<\/td>\n<td style=\"line-height:40px;font-weight:bold;\">DOMAIN_METRIC_domain_date<\/td>\n<\/tr>\n<tr>\n<td style=\"color:#9245db;\">\u2714<\/td>\n<td style=\"line-height:40px;font-weight:bold;\">INSTANCE_domain<\/td>\n<\/tr>\n<\/tbody><\/table><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Jennifer JDBC driver is manufactured in accordance with the standard SQL. For more about SQL functions and grammars to use, see the following link.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/calcite.apache.org\/docs\/reference.html\">SQL language (apache.org)<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, that\nis all I have to say about how to view data with Jennifer API servers and JDBC\ndrivers.<br>\nIn the next article, I will introduce you to the second function of \u201cUsing\nJennifer data with SQL\u201d<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"Using the Jennifer API server Jennifer saves the data collected per second in its own file system. The file system&#8230;","protected":false},"author":18,"featured_media":2329,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[78],"tags":[],"class_list":["post-2328","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech"],"acf":[],"_links":{"self":[{"href":"https:\/\/jennifersoft.com\/en\/wp-json\/wp\/v2\/posts\/2328","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jennifersoft.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jennifersoft.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jennifersoft.com\/en\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/jennifersoft.com\/en\/wp-json\/wp\/v2\/comments?post=2328"}],"version-history":[{"count":11,"href":"https:\/\/jennifersoft.com\/en\/wp-json\/wp\/v2\/posts\/2328\/revisions"}],"predecessor-version":[{"id":2510,"href":"https:\/\/jennifersoft.com\/en\/wp-json\/wp\/v2\/posts\/2328\/revisions\/2510"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jennifersoft.com\/en\/wp-json\/wp\/v2\/media\/2329"}],"wp:attachment":[{"href":"https:\/\/jennifersoft.com\/en\/wp-json\/wp\/v2\/media?parent=2328"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jennifersoft.com\/en\/wp-json\/wp\/v2\/categories?post=2328"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jennifersoft.com\/en\/wp-json\/wp\/v2\/tags?post=2328"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}