{"id":22058,"date":"2023-01-30T10:00:03","date_gmt":"2023-01-30T09:00:03","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/?p=22058"},"modified":"2025-10-24T09:38:30","modified_gmt":"2025-10-24T07:38:30","slug":"a-generic-jdbc-tester-part-ii","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/a-generic-jdbc-tester-part-ii\/","title":{"rendered":"A generic jdbc tester (part II)"},"content":{"rendered":"\n<p>This is part II of the article. See <a href=\"https:\/\/www.dbi-services.com\/blog\/a-generic-jdbc-tester-part-i\" target=\"_blank\" rel=\"noreferrer noopener\">Part I<\/a>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">A<em> <\/em>tale of 2 Oracle drivers<\/h4>\n\n\n\n<p>Oracle\u2019s drivers support 2 implementations: the pure java one as used above, also named Thin drivers, with the following URL syntax:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\njdbc:oracle:thin:@\/\/db_machine:listener_port\/service_name\n<\/pre><\/div>\n\n\n<p>but also the so-called OCI-based or Thick Type 2 drivers that rely on SQL*Net and the connect strings defined in <code>tnsnames.ora<\/code>, with the following syntax:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\njdbc:oracle:oci:@connect_string\n<\/pre><\/div>\n\n\n<p>Since they use OCI native libraries, they are said to be faster than their pure java implementation counterpart. To have those libraries, an InstantClient is needed at the minimum. Here, I\u2019m using an existing InstantClient v21.7 for Linux installation <code>\/u01\/dctm\/repo01\/oracle\/instantclient_21_7<\/code>. It comes with its own jdbc drivers which are incompatible with the ones downloaded before (but can do both Thin and OCI), so let\u2019s switch to the bundled ones. As they depend on native OCI libraries, those must be made accessible through the <code>LD_LIBRARY_PATH<\/code>.<\/p>\n\n\n\n<p>Here is the definition of the connect string <code>mypdb1<\/code> we will use; it has the same settings as the ones explicitly used with the Thin drivers:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nmypdb1 =\n  (DESCRIPTION =\n    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.21)(PORT = 1521))\n    (CONNECT_DATA =\n      (SERVER = DEDICATED)\n      (SERVICE_NAME = pdb1)\n    )\n  )\n<\/pre><\/div>\n\n\n<p>Let\u2019s adapt the environment and syntax, and try:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; highlight: [2,11,14,21]; title: ; notranslate\" title=\"\">\n$ export LD_LIBRARY_PATH=\/u01\/dctm\/repo01\/oracle\/instantclient_21_7\n$ java -cp \/u01\/dctm\/repo01\/oracle\/instantclient_21_7\/ojdbc8.jar:. jdbc_tester_generic oracle.jdbc.driver.OracleDriver repo01 repo01 jdbc:oracle:oci:@mypdb1 &quot;select &#039;now in Oracle db: &#039; || to_char(sysdate, &#039;DD\/MM\/YYYY HH24:MI:SS&#039;) as now from dual&quot;\nThe command-line parameters are:\narg 0 = oracle.jdbc.driver.OracleDriver\narg 1 = repo01\narg 2 = repo01\narg 3 = jdbc:oracle:oci:@mypdb1\narg 4 = select &#039;now in Oracle db: &#039; || to_char(sysdate, &#039;DD\/MM\/YYYY HH24:MI:SS&#039;) as now from dual\n\nLoading driver &#x5B;oracle.jdbc.driver.OracleDriver]:\nJDBC Driver oracle.jdbc.driver.OracleDriver successfully loaded\n\nConnecting to url &#x5B;jdbc:oracle:oci:@mypdb1] as user &#x5B;repo01]:\nSuccessful connection to database\n\nExecuting SQL query &#x5B;select &#039;now in Oracle db: &#039; || to_char(sysdate, &#039;DD\/MM\/YYYY HH24:MI:SS&#039;) as now from dual]:\n\nRetrieving the result set:\nnow in Oracle db: 22\/01\/2023 15:51:23\n\nJDBC connection successfully tested, quitting \u2026\n<\/pre><\/div>\n\n\n<p>As illustrated, since those drivers are based on OCI, they go through the SQL*Net stack to read the connectivity configuration behind the connect string <code>mypdb1<\/code>, namely from the <code>tnsnames.ora<\/code> file; hence this information does not need to be provided any more, which reflects in the simpler JDBC URL. Whenever the Oracle client is installed along with JDBC programs, it is preferable to use the OCI drivers to avoid replicating connection information instead of accessing it from one single place, although when working with RDBMS from different vendors, it is understandable to standardize to the Thin drivers for generality and portability. Anyway, there are sufficient differences in the URL syntax across RDBMS that one more does not change much. For example, Oracle Thin drivers also allows to specify the URL through the full, inlined <code>tnsnames.ora<\/code> syntax, e.g.:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; highlight: [2,11,14,16]; title: ; notranslate\" title=\"\">\n$ export LD_LIBRARY_PATH=\/u01\/dctm\/repo01\/oracle\/instantclient_21_7\n$ java -cp \/u01\/dctm\/repo01\/oracle\/instantclient_21_7\/ojdbc8.jar:. jdbc_tester_generic oracle.jdbc.driver.OracleDriver repo01 repo01 jdbc:oracle:thin:@&quot;(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) (HOST=192.168.0.21)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=pdb1)))&quot; &quot;select &#039;now in Oracle db: &#039; || to_char(sysdate, &#039;DD\/MM\/YYYY HH24:MI:SS&#039;) as now from dual&quot;\nThe command-line parameters are:\narg 0 = oracle.jdbc.driver.OracleDriver\narg 1 = repo01\narg 2 = repo01\narg 3 = jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) (HOST=192.168.0.21)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=pdb1)))\narg 4 = select &#039;now in Oracle db: &#039; || to_char(sysdate, &#039;DD\/MM\/YYYY HH24:MI:SS&#039;) as now from dual\n\nLoading driver &#x5B;oracle.jdbc.driver.OracleDriver]:\nJDBC Driver oracle.jdbc.driver.OracleDriver successfully loaded\n\nConnecting to url &#x5B;jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) (HOST=192.168.0.21)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=pdb1)))] as user &#x5B;repo01]:\nSuccessful connection to database\n...\nJDBC connection successfully tested, quitting \u2026\n<\/pre><\/div>\n\n\n<p>and so do the OCI drivers:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; highlight: [2,11,14,16]; title: ; notranslate\" title=\"\">\n$ export LD_LIBRARY_PATH=\/u01\/dctm\/repo01\/oracle\/instantclient_21_7\n$ java -cp \/u01\/dctm\/repo01\/oracle\/instantclient_21_7\/ojdbc8.jar:. jdbc_tester_generic oracle.jdbc.driver.OracleDriver repo01 repo01 jdbc:oracle:oci:@&quot;(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) (HOST=192.168.0.21)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=pdb1)))&quot; &quot;select &#039;now in Oracle db: &#039; || to_char(sysdate, &#039;DD\/MM\/YYYY HH24:MI:SS&#039;) as now from dual&quot;\nThe command-line parameters are:\narg 0 = oracle.jdbc.driver.OracleDriver\narg 1 = repo01\narg 2 = repo01\narg 3 = jdbc:oracle:oci:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) (HOST=192.168.0.21)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=pdb1)))\narg 4 = select &#039;now in Oracle db: &#039; || to_char(sysdate, &#039;DD\/MM\/YYYY HH24:MI:SS&#039;) as now from dual\n\nLoading driver &#x5B;oracle.jdbc.driver.OracleDriver]:\nJDBC Driver oracle.jdbc.driver.OracleDriver successfully loaded\n\nConnecting to url &#x5B;jdbc:oracle:oci:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) (HOST=192.168.0.21)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=pdb1)))] as user &#x5B;repo01]:\nSuccessful connection to database\n...\nJDBC connection successfully tested, quitting ...\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\"><strong>Using a SID with Oracle JDBC<\/strong><\/h4>\n\n\n\n<p>Oracle JDBC drivers allow to specify a service name, as shown so far, but also the deprecated, old-style SID. The URL syntax changes slighty. Here is a summary of the all the Oracle JDBC URL syntaxes:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; highlight: [3,5,9,11]; title: ; notranslate\" title=\"\">\n# with a service name;\n# Thin:\njdbc:oracle:thin:@\/\/192.168.0.21:1521\/pdb1\n# OCI:\njdbc:oracle:oci:@mypdb1\n\n# with a sid;\n# Thin:\njdbc:oracle:thin:@192.168.0.21:1521:orcl\n# OCI:\njdbc:oracle:oci:@mysid\n<\/pre><\/div>\n\n\n<p>with the following mysid\u2018s definition in <code>tnsnames.ora<\/code>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; highlight: [1,6]; title: ; notranslate\" title=\"\">\nmysid =\n  (DESCRIPTION =\n    (ADDRESS = (PROTOCOL = TCP)(HOST = db)(PORT = 1521))\n    (CONNECT_DATA =\n      (SERVER = DEDICATED)\n      (SID = orcl)\n    )\n  )\n<\/pre><\/div>\n\n\n<p>where <code>orcl<\/code> is the sid of the container database. As we are accessing the container database now, and the <code>repo01<\/code> account does not exist there, we must switch to a different account; let\u2019s use <code>system<\/code> as it is defined everywhere (however, it is still possible to access a pluggable database through its SID, and use the <code>repo01<\/code> account; for this, set the listener\u2019s parameter <code>USE_SID_AS_SERVICE_listener=on<\/code>; I did not try it though and I suspect that the service syntax will have to be used but with a SID instead of a service name).<\/p>\n\n\n\n<p>Let\u2019s adapt the environment and syntax, and try first with the OCI drivers:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; highlight: [2,11,14,16]; title: ; notranslate\" title=\"\">\n$ export LD_LIBRARY_PATH=\/u01\/dctm\/repo01\/oracle\/instantclient_21_7\n$ java -cp \/u01\/dctm\/repo01\/oracle\/instantclient_21_7\/ojdbc8.jar:. jdbc_tester_generic oracle.jdbc.driver.OracleDriver system manager jdbc:oracle:oci:@mysid &quot;select &#039;now in Oracle db: &#039; || to_char(sysdate, &#039;DD\/MM\/YYYY HH24:MI:SS&#039;) as now from dual&quot;\nThe command-line parameters are:\narg 0 = oracle.jdbc.driver.OracleDriver\narg 1 = system\narg 2 = manager\narg 3 = jdbc:oracle:oci:mysid\narg 4 = select &#039;now in Oracle db: &#039; || to_char(sysdate, &#039;DD\/MM\/YYYY HH24:MI:SS&#039;) as now from dual\n\nLoading driver &#x5B;oracle.jdbc.driver.OracleDriver]:\nJDBC Driver oracle.jdbc.driver.OracleDriver successfully loaded\n\nConnecting to url &#x5B;jdbc:oracle:oci:@mysid] as user &#x5B;system]:\nSuccessful connection to database\n...\nJDBC connection successfully tested, quitting ...\n<\/pre><\/div>\n\n\n<p>Using the full inline definition behind the mysid connect string:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; highlight: [2,11,14,16]; title: ; notranslate\" title=\"\">\n$ export LD_LIBRARY_PATH=\/u01\/dctm\/repo01\/oracle\/instantclient_21_7\n$ java -cp \/u01\/dctm\/repo01\/oracle\/instantclient_21_7\/ojdbc8.jar:. jdbc_tester_generic oracle.jdbc.driver.OracleDriver system manager jdbc:oracle:oci:@&quot;(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) (HOST=192.168.0.21)(PORT=1521))(CONNECT_DATA=(SID = orcl)))&quot; &quot;select &#039;now in Oracle db: &#039; || to_char(sysdate, &#039;DD\/MM\/YYYY HH24:MI:SS&#039;) as now from dual&quot;\nThe command-line parameters are:\narg 0 = oracle.jdbc.driver.OracleDriver\narg 1 = system\narg 2 = manager\narg 3 = jdbc:oracle:oci:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) (HOST=192.168.0.21)(PORT=1521))(CONNECT_DATA=(SID = orcl)))\narg 4 = select &#039;now in Oracle db: &#039; || to_char(sysdate, &#039;DD\/MM\/YYYY HH24:MI:SS&#039;) as now from dual\n\nLoading driver &#x5B;oracle.jdbc.driver.OracleDriver]:\nJDBC Driver oracle.jdbc.driver.OracleDriver successfully loaded\n\nConnecting to url &#x5B;jdbc:oracle:oci:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) (HOST=192.168.0.21)(PORT=1521))(CONNECT_DATA=(SID = orcl)))] as user &#x5B;system]:\nSuccessful connection to database\n...\nJDBC connection successfully tested, quitting ...\n<\/pre><\/div>\n\n\n<p>Let\u2019s try now this SID with the Thin driver:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; highlight: [1,10,13,15]; title: ; notranslate\" title=\"\">\n$ java -cp ojdbc11.jar:. jdbc_tester_generic oracle.jdbc.driver.OracleDriver system manager jdbc:oracle:thin:@192.168.0.21:1521:orcl &quot;select &#039;now in Oracle db: &#039; || to_char(sysdate, &#039;DD\/MM\/YYYY HH24:MI:SS&#039;) as now from dual&quot;\nThe command-line parameters are:\narg 0 = oracle.jdbc.driver.OracleDriver\narg 1 = system\narg 2 = manager\narg 3 = jdbc:oracle:thin:@192.168.0.21:1521:orcl\narg 4 = select &#039;now in Oracle db: &#039; || to_char(sysdate, &#039;DD\/MM\/YYYY HH24:MI:SS&#039;) as now from dual\n\nLoading driver &#x5B;oracle.jdbc.driver.OracleDriver]:\nJDBC Driver oracle.jdbc.driver.OracleDriver successfully loaded\n\nConnecting to url &#x5B;jdbc:oracle:thin:@192.168.0.21:1521:orcl] as user &#x5B;system]:\nSuccessful connection to database\n...\nJDBC connection successfully tested, quitting ...\n<\/pre><\/div>\n\n\n<p>Using the inline connect string definition with the Thin drivers:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; highlight: [1,10,13,15]; title: ; notranslate\" title=\"\">\n$ java -cp ojdbc11.jar:.:. jdbc_tester_generic oracle.jdbc.driver.OracleDriver system manager jdbc:oracle:thin:@&quot;(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) (HOST=192.168.0.21)(PORT=1521))(CONNECT_DATA=(SID = orcl)))&quot; &quot;select &#039;now in Oracle db: &#039; || to_char(sysdate, &#039;DD\/MM\/YYYY HH24:MI:SS&#039;) as now from dual&quot; \nThe command-line parameters are:\narg 0 = oracle.jdbc.driver.OracleDriver\narg 1 = system\narg 2 = manager\narg 3 = jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) (HOST=192.168.0.21)(PORT=1521))(CONNECT_DATA=(SID = orcl)))\narg 4 = select &#039;now in Oracle db: &#039; || to_char(sysdate, &#039;DD\/MM\/YYYY HH24:MI:SS&#039;) as now from dual\n\nLoading driver &#x5B;oracle.jdbc.driver.OracleDriver]:\nJDBC Driver oracle.jdbc.driver.OracleDriver successfully loaded\n\nConnecting to url &#x5B;jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) (HOST=192.168.0.21)(PORT=1521))(CONNECT_DATA=(SID = orcl)))] as user &#x5B;system]:\nSuccessful connection to database\n...\nJDBC connection successfully tested, quitting ...\n<\/pre><\/div>\n\n\n<p>As showed above, the utility <code>jdbc_tester_generic<\/code> is URL- and drivers-agnostic; just provide the right parameters and they will be passed unchanged to the drivers.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Other RDBMS<\/h4>\n\n\n\n<p>We tested <em>jdbc_tester_generic<\/em> with PostgreSQL and Oracle and chances are that it is really generic indeed as it could handle Oracle\u2019s multiple specificities. Nonetheless, let\u2019s try it with 7 more RDBMS, e.g. MariaDB\/MySQL, SQLite, Firebird, Microsoft SQL Server, HSQLDB, MongoDB and Excel, and see how it behaves. If you don\u2019t have those installed somewhere, concise instructions to do it are presented in several articles published on the dbi-services blog site https:\/\/www.dbi-services.com\/blog\/<a href=\"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-driver-manager-with-sqlite-on-linux\/\">installing-the-odbc-driver-manager-with-<\/a>*, e.g. <a href=\"https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-driver-manager-with-sqlite-on-linux\/\">https:\/\/www.dbi-services.com\/blog\/installing-the-odbc-driver-manager-with-sqlite-on-linux\/<\/a> for SQLite.<\/p>\n\n\n\n<p>After the installation of the software and the creation of the databases, their readiness can be verified via ODBC as explained in the articles. Hereafter, we assume that those databases are up and running, with valid credentials where applicable, and we will try to access them via JDBC this time.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">MariaDB<\/h5>\n\n\n\n<p>First, let\u2019s install the JDBC drivers for MariaDB:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\n$ wget https:\/\/dbschema.com\/jdbc-drivers\/MariaDbJdbcDriver.zip\n$ unzip MariaDbJdbcDriver.zip\n<\/pre><\/div>\n\n\n<p>The server\u2019s default port is 3306 but let\u2019s check it:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; highlight: [5,9,17]; title: ; notranslate\" title=\"\">\n$ netstat -tlnp\nActive Internet connections (only servers)\nProto Recv-Q Send-Q Local Address Foreign Address State PID\/Program name\n...\ntcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 112172\/mariadbd\n\n# or:\n$ grep -i &#039;port =&#039; \/etc\/mysql\/my.cnf\n$ port = 3306\n\n# or\n$ mysql\nshow variables like &#039;port&#039;;\n+---------------+-------+\n| Variable_name | Value |\n+---------------+-------+\n| port          | 3306  |\n+---------------+-------+\n1 row in set (0.006 sec)\n<\/pre><\/div>\n\n\n<p>Let\u2019s invoke the tester now:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; highlight: [1,10,13,20]; title: ; notranslate\" title=\"\">\n$ java -cp mariadb-java-client-3.0.6.jar:. jdbc_tester_generic org.mariadb.jdbc.Driver debian debian jdbc:mariadb:\/\/localhost:3306\/sampledb &quot;select concat(&#039;now in mysql db: &#039;, DATE_FORMAT(SYSDATE(), &#039;%d\/%m\/%Y %H:%i:%s&#039;)) as now;&quot;\nThe command-line parameters are:\narg 0 = org.mariadb.jdbc.Driver\narg 1 = debian\narg 2 = debian\narg 3 = jdbc:mariadb:\/\/localhost:3306\/sampledb\narg 4 = select concat(&#039;now in mysql db: &#039;, DATE_FORMAT(SYSDATE(), &#039;%d\/%m\/%Y %H:%i:%s&#039;)) as now;\n\nLoading driver &#x5B;org.mariadb.jdbc.Driver]:\nJDBC Driver org.mariadb.jdbc.Driver successfully loaded\n\nConnecting to url &#x5B;jdbc:mariadb:\/\/localhost:3306\/sampledb] as user &#x5B;debian]:\nSuccessful connection to database\n\nExecuting SQL query &#x5B;select concat(&#039;now in mysql db: &#039;, DATE_FORMAT(SYSDATE(), &#039;%d\/%m\/%Y %H:%i:%s&#039;)) as now;]:\n\nRetrieving the result set:\nnow in mysql db: 23\/01\/2023 21:13:00\n\nJDBC connection successfully tested, quitting ...\n<\/pre><\/div>\n\n\n<p>No surprise with MariaDB.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">SQLite<\/h5>\n\n\n\n<p>First, let\u2019s install the JDBC drivers for SQLite:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ wget https:\/\/repo1.maven.org\/maven2\/org\/xerial\/sqlite-jdbc\/3.40.0.0\/sqlite-jdbc-3.40.0.0.jar\n<\/pre><\/div>\n\n\n<p>Let\u2019s invoke the tester:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; highlight: [1,10,13,20]; title: ; notranslate\" title=\"\">\n$ java -cp sqlite-jdbc-3.40.0.0.jar:. jdbc_tester_generic java.sql.Driver debian debian jdbc:sqlite:\/path\/to\/database\/sampledb &quot;select &#039;now in sqlite db: &#039; || STRFTIME(&#039;%d\/%m\/%Y, %H:%M:%S&#039;, datetime()) as now;&quot;\nThe command-line parameters are:\narg 0 = java.sql.Driver\narg 1 = debian\narg 2 = debian\narg 3 = jdbc:sqlite:\/path\/to\/database\/sampledb\narg 4 = select &#039;now in sqlite db: &#039; || STRFTIME(&#039;%d\/%m\/%Y, %H:%M:%S&#039;, datetime()) as now;\n\nLoading driver &#x5B;java.sql.Driver]:\nJDBC Driver java.sql.Driver successfully loaded\n\nConnecting to url &#x5B;jdbc:sqlite:\/path\/to\/database\/sampledb] as user &#x5B;debian]:\nSuccessful connection to database\n\nExecuting SQL query &#x5B;select &#039;now in sqlite db: &#039; || STRFTIME(&#039;%d\/%m\/%Y, %H:%M:%S&#039;, datetime()) as now;]:\n\nRetrieving the result set:\nnow in sqlite db: 23\/01\/2023, 22:02:13\n\nJDBC connection successfully tested, quitting ...\n<\/pre><\/div>\n\n\n<p>No surprise with SQLite either.<\/p>\n\n\n\n<p>See <a href=\"https:\/\/www.dbi-services.com\/blog\/a-generic-jdbc-tester-part-iii\/\" target=\"_blank\" rel=\"noreferrer noopener\">Part III<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A generic utility to test JDBC connections to any RDBMS or no SQL data source whose JDBC drivers are provided. Oracle OCI, MariaDB and SQLite.<\/p>\n","protected":false},"author":40,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1726,59],"tags":[],"type_dbi":[],"class_list":["post-22058","post","type-post","status-publish","format-standard","hentry","category-mariadb","category-oracle"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>A generic jdbc tester (part II) - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/a-generic-jdbc-tester-part-ii\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A generic jdbc tester (part II)\" \/>\n<meta property=\"og:description\" content=\"A generic utility to test JDBC connections to any RDBMS or no SQL data source whose JDBC drivers are provided. Oracle OCI, MariaDB and SQLite.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/a-generic-jdbc-tester-part-ii\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-30T09:00:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-24T07:38:30+00:00\" \/>\n<meta name=\"author\" content=\"Middleware Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Middleware Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/a-generic-jdbc-tester-part-ii\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/a-generic-jdbc-tester-part-ii\/\"},\"author\":{\"name\":\"Middleware Team\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1\"},\"headline\":\"A generic jdbc tester (part II)\",\"datePublished\":\"2023-01-30T09:00:03+00:00\",\"dateModified\":\"2025-10-24T07:38:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/a-generic-jdbc-tester-part-ii\/\"},\"wordCount\":728,\"commentCount\":0,\"articleSection\":[\"MariaDB\",\"Oracle\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/a-generic-jdbc-tester-part-ii\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/a-generic-jdbc-tester-part-ii\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/a-generic-jdbc-tester-part-ii\/\",\"name\":\"A generic jdbc tester (part II) - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2023-01-30T09:00:03+00:00\",\"dateModified\":\"2025-10-24T07:38:30+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/a-generic-jdbc-tester-part-ii\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/a-generic-jdbc-tester-part-ii\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/a-generic-jdbc-tester-part-ii\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A generic jdbc tester (part II)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1\",\"name\":\"Middleware Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g\",\"caption\":\"Middleware Team\"},\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/middleware-team\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"A generic jdbc tester (part II) - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/a-generic-jdbc-tester-part-ii\/","og_locale":"en_US","og_type":"article","og_title":"A generic jdbc tester (part II)","og_description":"A generic utility to test JDBC connections to any RDBMS or no SQL data source whose JDBC drivers are provided. Oracle OCI, MariaDB and SQLite.","og_url":"https:\/\/www.dbi-services.com\/blog\/a-generic-jdbc-tester-part-ii\/","og_site_name":"dbi Blog","article_published_time":"2023-01-30T09:00:03+00:00","article_modified_time":"2025-10-24T07:38:30+00:00","author":"Middleware Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Middleware Team","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/a-generic-jdbc-tester-part-ii\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/a-generic-jdbc-tester-part-ii\/"},"author":{"name":"Middleware Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1"},"headline":"A generic jdbc tester (part II)","datePublished":"2023-01-30T09:00:03+00:00","dateModified":"2025-10-24T07:38:30+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/a-generic-jdbc-tester-part-ii\/"},"wordCount":728,"commentCount":0,"articleSection":["MariaDB","Oracle"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/a-generic-jdbc-tester-part-ii\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/a-generic-jdbc-tester-part-ii\/","url":"https:\/\/www.dbi-services.com\/blog\/a-generic-jdbc-tester-part-ii\/","name":"A generic jdbc tester (part II) - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2023-01-30T09:00:03+00:00","dateModified":"2025-10-24T07:38:30+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/a-generic-jdbc-tester-part-ii\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/a-generic-jdbc-tester-part-ii\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/a-generic-jdbc-tester-part-ii\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"A generic jdbc tester (part II)"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1","name":"Middleware Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g","caption":"Middleware Team"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/middleware-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/22058","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=22058"}],"version-history":[{"count":18,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/22058\/revisions"}],"predecessor-version":[{"id":22099,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/22058\/revisions\/22099"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=22058"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=22058"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=22058"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=22058"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}