views:

658

answers:

3

We are trying to connect to a SQL Server instance used by the ACT CRM system. They have managed to lock things down so it isn't possible to connect to the SQL back-end using ODBC (there is some special utility that will add ODBC support that you can install if you purchase the primo version of the software, but that's just crazy).

The recommended method of connecting to theses databases is using an OLEDB connection.

Does anyone have any tricks/ideas/etc... for how to make and use an OLEDB connection from Java?

This doesn't have to be JDBC if that's not possible. All we really need to do is execute a SELECT query that returns two fields and parse those field values out for each row. I have very little experience with OLEDB, so 'use JACOB' might be a good answer, but I'd appreciate some details on what the COM calls would actually have to be.

A: 

Java can not access OLEDB directly. You need to do this in another language like C++ or C#. Then you can access via JNI or external process. If you does not want write the native part of JNI self then you can use JACOB how you suggest it. But I think an external process take the request seem be simpler.

Horcrux7
A: 

Two ways to solve this issue.

1) Spawn from java an external proc (c#, c++, etc) that connects to SQLSrv using OLEDB and redirect the stdin, stdout and stderr to your java program. 2) Create a C# listener on a particular port and have java pass all the requests via a client to that listener.

Fun stuff

Al
A: 

Or use: http://uda.openlinksw.com/jdbc/mt/jdbc-sqlserver-mt/ They develop all kinds of drivers. I used this company before...

Al