General questions about accessing DDS data via JDBC

27 views
Skip to first unread message

Pasqualino Imbemba

unread,
Oct 3, 2020, 7:54:38 AM10/3/20
to
Hello everyone,

I have some basic questions about AS400/DB2 using IBM DDS:

1) Is it possible to act on data contained in physical files through
JDBC connector? (SELECT, INSERT INTO,...) - the DB2 should present them
as SQL tables;
2) The relations (keys) are contained in logical files. When accessing
via JDBC/SQL, do I have to pay attention to relationships in logical
files, or are elements like referential integrity safeguarded by the RDBMS?
3) Best practice: Should I ask Stored Procedures to call via JDBC or act
directly on the data?
4) If I download the DB2 free edition, could I test this DDS/SQL
interaction behaviour?

Thanks
#pasquale


Steve Richter

unread,
Oct 3, 2020, 10:19:48 AM10/3/20
to
> 1) Is it possible to act on data contained in physical files through
> JDBC connector? (SELECT, INSERT INTO,...) - the DB2 should present them
> as SQL tables;

yes, physical (and logical ) files are seen as Tables by DB2.

> 2) The relations (keys) are contained in logical files. When accessing
> via JDBC/SQL, do I have to pay attention to relationships in logical
> files, or are elements like referential integrity safeguarded by the RDBMS?

I do not know much about referential integrity. As far as logicals, logical files are found in SYSTABLES. Meaning, you can insert into, update, delete from a logical file.

> 3) Best practice: Should I ask Stored Procedures to call via JDBC or act
> directly on the data?

yes, access the database thru sql procedures. One advantage is the sql procedure can adopt the authority of the owner of the procedure. This way, *public rights to the database table can be restricted.

> 4) If I download the DB2 free edition, could I test this DDS/SQL
> interaction behaviour?

the free version is DB2 for windows or linux? On the IBM i DB2 is not installed separately. It is integrated into the system. You need IBM i hardware and OS to use SQL on the system.

-Steve

Pasqualino Imbemba

unread,
Oct 3, 2020, 11:09:06 PM10/3/20
to
Il 03/10/20 16:19, Steve Richter ha scritto:

>> 4) If I download the DB2 free edition, could I test this DDS/SQL
>> interaction behaviour?
>
> the free version is DB2 for windows or linux? On the IBM i DB2 is not installed separately. It is integrated into the system. You need IBM i hardware and OS to use SQL on the system.

The free DB2 edition for linux. AFAIK it's limited to 200 MB of space,
but I'd like to create just a couple of physical and logical files, and
access them through JDBC to see how it's behaving.

Thanks
#pasquale


Reply all
Reply to author
Forward
0 new messages