pavanlapr
pavanlapr

Reputation: 279

Does a java application that uses JDBC 4 driver type requires db2 binding

Our java applications will access legacy mainframe db2 databases. I remember in my previous projects, C++ applications required db2 binding before deployment. In current projects, all mainframe applications, Cobol packages are also required to do db2 binding.

Does a java application that uses jdbc4 driver needs db2 binding too?

Upvotes: 2

Views: 813

Answers (3)

Gokcer Belgusen
Gokcer Belgusen

Reputation: 11

If your DB2 version supports Dynamic Statement Caching and enabled (consult your DBA’s), you can use JDBC Type-4 driver to access mainframe DB2 database (use prepare statement) without binding.

DB2 will generate access paths and store it in first request into cache. Otherwise, you need use SQLJ like technologies and bind them.

Upvotes: 0

AngocA
AngocA

Reputation: 7693

If you are using standard JDBC you are creating dynamic SQL (PrepareStatement) that do not requires binding in DB2 side.

However, if you use SQLj, you will need to 'precompile' that code to generate you .java files and another file to bind in the database.

It does not matter if you are connecting to a mainframe (system z or i) or to a DB2 LUW. The concept is the same for all platforms as DB2 is DB2.

SQLj is not very popular, however is very powerful to tune your queries and improve the data access, however, as you used to do in C, the code has to be developped in more phases, and you have to rebind each time the access plan has to be modified (new statisques, security, etc.)

SQLj is very easy to use from Data Studio, and SQLj from DB2 is not exactly the same from Oracle.

Upvotes: 1

duffymo
duffymo

Reputation: 308763

The JDBC type IV driver, supplied by IBM, will handle everything you need to do.

The driver maps Java objects into DB2 appropriately.

I don't know what "binding" means in this context. Java is not C++.

Upvotes: 1

Related Questions