horst.keller has already introduced ADBC in his blog ABAP Geek 15 – ADBC long times ago. And recently during my self study on PostgreSQL I made some practice to connect PostgreSQL in Java programming using Java Database Connectivity - JDBC. In fact I found out that there are lots of commonality between these two technologies.
There is a demo program demo_adbc_query mentioned in SAP help to demonstrate the use of ADBC.
I make some changes on it in order to perform a line-by-line comparison with JDBC.
The source code of adapted program:
CLASS demo DEFINITION.
CLASS-DATA: BEGIN OF result_line,
carrid TYPE sflight-carrid,
connid TYPE sflight-connid,
fldate TYPE sflight-fldate,
END OF result_line,
result_tab LIKE TABLE OF result_line.
CLASS demo IMPLEMENTATION.
DATA: carrid TYPE sflight-carrid VALUE 'AA',
cols TYPE adbc_column_tab,
lv_carrid TYPE string,
con_ref TYPE REF TO cl_sql_connection,
con_name TYPE dbcon-con_name VALUE 'DEFAULT'.