Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Invalid Escape character in connnection string

I'm using jodbc to connect to my SQL Server db. For brevity I have to use this type of connection. Our sql server has an instance name besides default.
My connection string is:
"jdbc:sqlserver://10.1.0.34\CLSDev;databaseName=CNTLAND_LMSLINK_TALENDTEST";
which Checks and works (I'm able to connect and load table schema).
Howerver when I run my job I keep getting the following error:
Invalide escape sequence (following are valid....)
I'm looking at the code and it errors on the following:
String url_tJDBCConnection_1 = "jdbc:sqlserver://10.1.0.34\CLSDev;databaseName=CNTLAND_LMSLINK_TALENDTEST";
How do I get to use the instance name but keep the "invalid escape character"?
thanks!
Labels (3)
5 Replies
janhess
Creator II
Creator II

In additional parameters set instance=instancename eg instance=CLSDev
alevy
Specialist
Specialist

Try doubling the backslash in the connection string since that is an escape character for Java.
Anonymous
Not applicable
Author

Hi,
1. I don't see where I can set additional parameters, there is no box for that.
2. I tried the double back slash and it doesn't work.
any other thoughts?
-Leon
Anonymous
Not applicable
Author

Hi,
1. I don't see where I can set additional parameters, there is no box for that.
2. I tried the double back slash and it doesn't work.
any other thoughts?
-Leon

The additional parameters text is not available in tJDBCxxx component. Double backslash should be ok, I tested and it don't have compilation error.
"jdbc:sqlserver://10.1.0.34\\CLSDev;databaseName=CNTLAND_LMSLINK_TALENDTEST"
Anonymous
Not applicable
Author

I am facing the same problem when I try to connect to my defualt instance that is 192.168.6.46 it works fine
But when I use connectionstring as jdbc:jtds:sqlserver://192.168.6.46//test:1433/databaseName=bd_ip;
I get an error as login failed for User sa

Please help