I am evaluating the ODBC-2-JDBC Bridge and I have a problem during the following configuration:
- MSSql-Server running on machine A.
- Another MSSql-Server running on machine B and providing only a JDBC interface.
- I want to query data placed on B from A using a DBLink on A.
On machine A, I have built a database link to machine B, while the link is configured to use ODBC2JDBC-Bridge (Lite-Edition) (with official MSSqlServer-jdbc-driver).
So far, simple statements are forwarded and executed correctly.
The problem arises with queries, that are based on a PreparedStatements construction.
The test case:
Query ___________ -- Declare the variable to be used. DECLARE @Val int; -- Initialize the variable. SET @Val = 4; select * from BRIDGELINK.master.dbo.test where value = @Val; Result (Microsoft SQL Server Management Studio 17) ___________ Msg 7399, Level 16, State 1, Line 8 The OLE DB provider "MSDASQL" for linked server "BRIDGELINK" reported an error. The provider reported an unexpected catastrophic failure. Msg 7399, Level 16, State 1, Line 8 The SELECT "Tbl1002"."value" "Col1004" FROM "master"."dbo"."test" "Tbl1002" WHERE "Tbl1002"."value"=?-query for OLE DB provider "MSDASQL" for linked server "BRIDGELINK" cannot be executed. Notes ___________ - BRIDGELINK is a MSSQL DB-Link to a Database using the 'Openlink ODBC to JDBC'-Driver, which includes the MSSQL JDBC driver. - table 'test' is a testtable with 'value' as integer column including the values 1, 2, 4, 4. - The Query works without the ODBC-to-JDBC-Bridge (just using MS ODBC driver for linked connection). - Query was also tested with the provided 'C++ Demo' application with the same result. - The static Query 'select * from BRIDGELINK.master.dbo.test where value = 4' works well. The failure arises when a variable is used. We alredy tested the "emulate PreparedStatements"-option in OpenLink-Driver configuration without success.
Do you have any experience with this problem? Any advice would be appreciated.