IBM DB2 Type 4 driver? - db2

Where can I find the redistributable version of the IBM DB2 Type 4 driver?
I suppose this is the driver I would use to connect from a Java app (on windows) to DB2 on the mainframe?

You will not be able to connect to the mainframe with any redistributable JDBC driver. The driver pack consists of the actual type 4 driver (db2jcc.jar) and any number of license files of the form:
db2jcc_license_cisuz.jar
where the cisuz bit is variable, indicating the platforms that you're allowed to run on (iSeries, pSeries, System z, LUW and so on).
You're only likely to get cu with any freely distributable pack. You need the z to access DB2 on the mainframe and that's jealously guarded so you'll need to purchase a specific edition of DB2 Connect to get it. I think both PE and EE, the personal and enterprise editions, have this licence file.
Without that license file, the type 4 driver won't even try to talk to the server, you'll get an exception.

IBM's Fix pack site has the "IBM Data Server Driver for JDBC and SQLJ" which is nothing but the JDBC type 4 driver. Though the page I pointed to above happens to be the windows page, it's the same type 4 driver for all platforms, as should be expected.
I don't think any user/password is required.

There is no need to download the JDBC driver separately it is already shipped with your DB2 product.
You can easily find it at this location : C:\Program Files\IBM\SQLLIB\java\db2jcc.jar
db2jcc.jar is the driver name

You can get the drivers from the IBM site. You will need to have IBM ID and password to login (which you can obtain here). Zip file is about 7 MBs, in contains DB2 9.5 JDBC (type 2/4) and SQLJ drivers. Type 4 drivers are in db2jcc4.jar.
However, you won't be able to connect to mainframes with this driver if mainframe is running DB2 for z/OS. To do so, you need at least to purchase DB2 Connect product, which will cost you about $500 minimum.

If you're running on an AS/400 (or iSeries, or whatever the heck IBM is calling it these days), you'll probably want to get it from JTOpen.
Their toolbox replaces the old Java Toolbox and includes the JDBC drivers.

If I need any IBM JARs for DB2 or MQ, I usually just add it to the instructions that DB2 or MQ needs to be installed as a prerequisite along with a URL to download it.
The same goes for Java and many other not easily redistributable products as well.
This eliminates the need to worry about licensing issues as it would be on the onus of the user rather than the vendor to obtain the proper licenses.

Related

IBM DB2 V7.2 ODBC Driver for Linux

I am trying to connect to a client's DB2 v7.2 database in Linux.
I am pretty new to DB2 and could not find 7.2 odbc driver in IBM site. The earliest is 9.1 odbc driver. Is this compatible with v7.2 ?
IBM does not make such old legacy drivers publicly available, for good reasons.
Genuine IBM customers always have a way to acquire legacy drivers however, although this is wholly dependent on who you know.
The v9.1 ODBC driver might have trouble accessing v7.2. It rather depends on which fixpacks are deployed (client and server), which operating-system (for client), and what authorization level you have for the target instance, and what rights you have at the workstation end, apart from the level of competence needed. This is not work for beginners.
Keep in mind that legacy drivers may not be able to install on modern workstation operating-system versions (for example , they might need the workstation operating system to be also a legacy version).
Another approach is to have a detailed understanding of exactly how (with which versions and tools) the client currently connects to that legacy database, and then seek to emulate that mix of versions, possibly by cloning.
This is not a programming question so stackoverflow may not be the correct forum. There are IBM specific forums run by IBM which may help.

Choosing the correct DB2 drivers to get data acceleration

In order to connect to IBM DB2 from either Excel or a C# .net application, which driver do I need in order to also get the data acceleration? (set current query acceleration all;) Are there drivers that are portable (don't need admin rights to install)?
If they do need admin, I can always ask IT support to install it for me..
Have been using JDBC drivers for my Squirrel SQL client, and they support IBM IDAA (acceleration), but these won't work with Excel nor C#. Obviously.
Any pointers?
To access Db2-for-Z/OS from either Excel or C# .net you will need a CLI driver for Db2 with matching bitness.
Depending on how your Db2-for-Z/OS subsystems are licensed you may also need a license-file on the Microsoft-windows workstation, becase IBM supplied CLI drivers are not free for accessing Db2-fo-Z/OS. Speak with your Z-DBA or passport-advantage-coordinator to get the license-file (and the correct version of it to match your version of Db2-for-Z/OS) or to determine if the target subsystem has already db2connectactivate enabled ( meaning no workstation based licenses are required).
IBM and other companies offer CLI drivers for Db2 for various operating systems including Microsoft Windows.
IBM offers different sizes of CLI driver, depening on how much functionality you need.
Any of these should work with IDAA as long as they are "current", and the keywords needed for IDAA exploitation should be common between the IBM supplied CLI drivers.
The smallest footprint, minimal function, zero install CLI driver from IBM is the "ODBC and CLI" driver, which is a zipfile (just unzip and register it per the docs). Get it via this link, and then install it per this documentation. Note that this driver gets frequently updated, as it is used by all CLI/ODBC based tools (perl, python, r, c#, ruby, c++, ...). It's also possible to use wget to download it. google for that.
A larger driver is the "Db2 runtime client", which has more functionality and the clpplus interface. This is available via the IBM Passport Advantage website , or via fix central for latest fixpacks.
The full Db2 client is a large image, and has all functionality that IBM offers for client side use. Get this via the IBM Passport Advantage website, or via fix central for latest fixpacks.

How can I tell SQLDeveloper which version of JDBC to use?

I need to connect to an Oracle 9i server from my machine using SQLDeveloper. I already have a functioning version of SQLDeveloper 18.2 + Oracle Client 12 for more modern databases, but for this connection I want a separate older version of SQLDeveloper.
I've installed SQLDeveloper 3.2.20.09 in a separate folder on my machine and can launch it, but it defaults to finding the ojdbc6.jar file from Oracle Client 12. if I go to Help > About and select properties, the jdbc.library says jdbc.library /C:/app/client/product/12.1.0/client_1/jdbc/lib/ojdbc6.jar
and if I try to connect I get the error ORA-01460: unimplemented or unreasonable conversion requested
I tried putting the path to the SQL Developer 3.2 install first in the PATH variable, but no difference. Is there a way to tell SQL Developer which jdbc driver to use for Oracle ? (maybe in sqldeveloper.conf)
The official answer is:
use the jar (driver) we ship with the product OR
use a Thick Client, and we'll pull the jdbc driver from an Instant Client or Oracle HOME on your machine
The 2nd option will work so long as you don't try to go back back or forward in time to the point that the software will recognize/support the driver.
In other words, you can't tell SQL Developer 18.x to use a 9i Home, we have a hard dependency to require at least a 11gR2 client (I believe, it could actually be a 12c based client which is required).
You'd be better off getting your data out of that ancier 9i Database and into a modern 12 or 19c Oracle instance.
but it defaults to finding the ojdbc6.jar file from Oracle Client 12.
Sounds like you've managed to get a thick connection defined, go into preferences and disabled on the advanced page any reference to OCI or Thick, then it will use the jdbc driver shipped with SQLDev.

Where can i get these two jars - db2jcc4_license_cu and db2jcc4_license_cisuz?

I am trying to configure my project with IBM WAS 8.5.5.12 with J.D.K 1.8 and need type 4 driver for connection.
I'm assuming you are talking about DB2 for z/OS.
Then the answer can be found here. The important parts:
The db2jcc_license_cisuz.jar file is included in all DB2 Connect server editions including DB2 Connect Personal Edition. The license is also part the IBM Database Enterprise Developer Edition. If you already have one of these products, then please use the license file from the DB2 Connect Activation CD. If you have a Passport Advantage account, then remember to download the activation key from Passport Advantage for the DB2 Connect edition that you have purchased.
The db2jcc_license_cisuz.jar file is located in the /db2/license directory of the activation CD or activation file downloaded from Passport Advantage.
And:
I don't have a DB2 Connect product. Now what do I do?
If you do not have the file, then you must purchase a DB2 Connect product so that you may license the JDBC driver to connect to a mainframe.
Probably your DB2 administrators can provide you with the files...

Oracle Driver Installation

I am having Oracle 10g installed on my laptop and have downloaded ojdbc14.jar driver for the same. The problem is, my operating system is Windows 7, and I'm not having option to create a Data Source for Oracle since I m not having oracles driver installed. I m having option to create a Data Source for SQL server 6, but I want to get connected to Oracle. Please Help.
By 'Data Sources', I'm guessing that you mean Data Sources (ODBC), under Control Panel > Administrative Tools. Is this correct?
I've set up ODBC Data Sources that connect to Oracle databases before, but to do that I've needed the Oracle client to be installed. However, if you're having the full database installed on your laptop (as your question suggests), you won't need the client - that's only used to connect to databases running on other machines. I believe the full database contains everything in the client, so you should be able to set up an ODBC Data Source pointing to the database on your laptop once the database has been installed.
The ojdbc14.jar just contains the JDBC classes to talk to an Oracle database, and only programs written in Java (and other languages that run on the JVM such as Scala, Groovy or Clojure) can use it. This jar on its own not enough to be able to set up an ODBC data source.
Oracle currently has 1 version that is certified for windows 7. That version is 11.2. They have indicated that they plan to certify 10.2.0.5 if this happens there will likely be a patch that will be needed.
This is probably why the Data Source does not work, either ODBC or OLEDB.
Another possibility is that you have installed the 32bit version of Oracle and your OS is 64bit then you would need to use the 32bit Data Source administrative tools.
I have figured out the solution for my problem. All that I needed to do is put ojdbc14.jar file in my class path and then I was able to use it. Though by doing so, I needed to make some change in the code. I was no more able to use Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") instead I needed to use Class.forName("oracle.jdbc.OracleDriver") also instead of using my data source as "jdbc:odbc:somename" I needed to use jdbc:oracle:thin:#localhost:1521:xe.