Five Stars

Cannot connect to a SQL server database

Hi,

 

I'm trying to create a Db connection to a sql server database from my PC, but don't succeed when using Talend.

However, I am able to connect to the database through Toad and SQL Management Studio (from the same PC). I've tried both "Open Source JDTS" and Microsoft's JDBC driver, version 6.0. I'm using Talend 6.5.1.

The error I get is "Unknown server hostname patzorg_prd\patzorg_prd" when using "Open Source JDTS". The first part of "patzorg_prd\patzorg_prd" is indeed a valid hostname, I can ping it. The second patzorg_prd is probably a directory or something like that (I got this string from our DBA..).

This is the string of connection (Open Source JDTS):

 

jdbc:jtds:sqlserver://patzorg_prd\patzorg_prd:1433/Ultimo_prd;

 

Please note that both Toad and SQL Management Studio accept "patzorg_prd\patzorg_prd" as a hostname / servername and that I am able to connect to the database with these tools.

 

I also have to point out that I succeeded in connecting to another database with this string jdbc:sqlserver://pip:1433;DatabaseName=UltimoTest;

In this case the hostname is simply "pip".

 

So it problaby has to do with the second part. Any idea what's wrong?

 

Thanks in advance!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Eight Stars

Re: Cannot connect to a SQL server database

Hello,

 

"patzorg_prd" is name of the named instance (there are default and named instances in SQL Server). Please use the following configuration (change the user if needed). Capture.JPG

 

 

 

 

 

 

Regards

Lojdr

5 REPLIES
Fifteen Stars

Re: Cannot connect to a SQL server database

My suspicion is that your hostname is the cause of this because of the backslash. Talend is a Java tool and uses a backslash as an escape character. I can't test this here (so this is entirely a guess) but could you specify your hostname as "patzorg_prd\\patzorg_prd" and see if that works?

Rilhia Solutions
Eight Stars

Re: Cannot connect to a SQL server database

Hello,

 

"patzorg_prd" is name of the named instance (there are default and named instances in SQL Server). Please use the following configuration (change the user if needed). Capture.JPG

 

 

 

 

 

 

Regards

Lojdr

Fifteen Stars

Re: Cannot connect to a SQL server database

Ah, good spot @lojdr 

Rilhia Solutions
Five Stars

Re: Cannot connect to a SQL server database

Ah, that's it! I was able to connect by changing the connection string into

 

jdbc:jtds:sqlserver://patzorg_prd:1433/Ultimo_prd;instance=patzorg_prd

 

Thanks for the quick reply!

Eight Stars

Re: Cannot connect to a SQL server database

Thank you @rhall_2_0 and @Erik0067