Hi.
I need to connect to a Sql server that has a linked server where is the table I need.
it is possible to do it with b4j the
driver net.sourceforge.jtds.jdbc.Driver and the jdbcsql library.
You don't need to do anything to connect to the " linked server".
Once connected to your main server (I guess that's why Erel's ask you), assuming everything is correctly configured on your server, what you must change are your queries, with OPENQUERY, indicating the name of the linked server and your query sentence.
SQL:
Dim RS As ResultSet = SQL.ExecQuery("SELECT * FROM OPENQUERY([linkedServerName], 'SELECT * FROM {linkedDB}.{schema}.{table}')")
--eg:
Dim RS As ResultSet = SQL.ExecQuery("SELECT * FROM OPENQUERY([toshiba], 'SELECT Name FROM Sales.dbo.Customer')")
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.