architecture mismatch between the Driver and Application? - eclipse

I am using JDBC to connect to my microsoft access database.
I get the following exception when I try to connect to the database:
java.sql.SQLException: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application
I am using 64bit windows7, and I am using eclipse which is also a 64bit version My database is a microsoft access database and it seems that the driver is a 32bit driver which is causing the problem.
Any help on how to solve this problem would be greatly appreciated.

Check out the access 2010 redist
Microsoft Access Database Engine 2010 Redistributable
This download will install a set of components that can be used by non-Microsoft Office applications to read data from and write data to Office 2010 system files such as Microsoft Access 2010 (mdb and accdb) files and Microsoft Excel 2010 (xls, xlsx, and xlsb) files. Connectivity to text files is also supported.
ODBC and OLEDB drivers are installed for application developers to use in developing their applications with connectivity to Office file formats.
This should suit your needs. Good luck!

I don't have enough reputation yet to vote Yoda up, but I have to say that his solution is the most elegant I've come across. You could have also used a 32-bit JVM, but that is kind of silly. (If you encounter this on IIS you can make the application pool 32-bit, which is sort of the same thing.)

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.

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.

DB2 Transport Component is not registered correctly

I'm trying to test the DB2 adapter for BizTalk 2006 (not R2).
While trying to configure an instance in an application, I get an error stating:
DB2 Transport Component is not registered correctly
The enivronment is 2 BizTalk servers sharing a messagebox.
The DB2 adapter works fine on the first server. It is the second server I am having problems with.
I've exported the .msi files from the first server, then installed them onto the second server and imported them into BizTalk. All of the other adapters that I'm using work fine on both servers.
Google searches don't bring up a whole lot regarding troubleshooting the BizTalk DB2 adapter.
Further troubleshooting has shown that MS BizTalk Adapters for Host Systems is installed on both machines. However, it was only configured on the machine that is giving me the issue.
I've unconfigured it, but that still has not helped.
I've double checked tht version numbers of the .dll's for the DB2 adapter are the same on both servers, and made sure that they are installed in the GAC.
None of this has helped.
Has anyone run into an issue like this before, or point me in the direction of where to look for BizTalk DB2 adapter troubleshooting guidence?
When the "registered" word appears, I think about the registration of COM components, not the installation of .NET assemblies. The underlying driver the DB2 adapter uses is the Microsoft ODBC Driver for DB2. You may want to check if your ODBC DSN control panel shows up that particular driver for you to configure a DSN.
I'd recommend a reinstallation for the Adapter pack for Host Systems.

IBM DB2 Type 4 driver?

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.