Troubleshooting
JDBC SQL Server URL backslash: instance name, not escaping
Short answer
Type the backslash in a SQL Server JDBC URL literally: it separates the host from the named instance, and the documented URL grammar shows it unescaped. When the connection still fails, the causes to check are the test instance's own TCP port and then TLS negotiation, fixed in the java.security file, not the backslash.

On this page
- Do you have to escape the backslash in a JDBC SQL Server URL?
- What does the part after the backslash actually identify?
- How do you write the connection URL for a named instance?
- Which port belongs in the URL for a named instance?
- What if the URL is right and the connection still fails?
- How do you tell a URL fault from a TLS fault?
- Questions asked
No, the backslash in a JDBC connection URL to SQL Server is not escaped. It is the documented separator between the host and the named instance, shown bare in the general form of the connection URL for the Microsoft JDBC driver and in the syntax hint the MSSQL driver entry prints in an Ignition database connection. Type it once and move on. In the case this article resolves, the backslash was typed correctly the whole time and was never the fault: the test connection first failed on the instance's TCP port, which differed from the production server's single-default-instance layout, and then on a TLS version mismatch that the network admin cleared with a change to the java.security file of the Java runtime making the connection. The sections below give the URL forms, the port logic, and the rule for reading the error.
Do you have to escape the backslash in a JDBC SQL Server URL? #
No — enter the backslash exactly once, because the general form documented for the Microsoft JDBC driver, jdbc:sqlserver://[serverName[\instanceName][:portNumber]][;property=value], contains it bare, and the MSSQL driver hint in the Ignition connection editor prints the same host\instanceName[:port] shape.
There is no escape rule to look up. In the URL grammar the backslash is structure, not content: it marks where the server name ends and the instance name begins, and the documentation presents it that way. The instinct to double the character comes from contexts where a backslash really is an escape instruction, and plant software has several. String handling in RSLogix 500 treats backslash and the caret as escape characters. Scripted file output in WinCC trips on fprintf backslash escape issue. A JDBC connection URL is not one of those contexts, so nothing quotes, doubles or replaces the separator before it goes into the connection field.
What does the part after the backslash actually identify? #
The text after the backslash is the SQL Server instance name, not part of the machine name: serverName\sv means host serverName running instance sv, and since Windows machine names cannot contain a backslash, a server string that seems to hold one is always the host-plus-instance convention.
One Windows host can run several SQL Server instances side by side, each with its own databases, its own listener and its own port. The default instance is addressed by the machine name alone; every additional instance is addressed as host\instanceName. In the resolved case the production server hosted a single instance, so its connection never needed the convention, while the test server did — which is why copying the production string made the problem look like an escaping question. Reading the address as two values also settles the worry about a machine name that contains a backslash: Windows forbids the character in a computer name, so such a string can only be host plus instance, entered literally on both sides.
How do you write the connection URL for a named instance? #
Build it from three confirmed values — host, instance name, and the port that instance listens on — and write one backslash between host and instance; an explicit port and an instance name are both documented address parts, and the combined host\instanceName:portNumber shape connected in the resolved case.
Work from the server outward, in this order:
- Confirm the host — the server's machine name or address, resolved the way your network resolves it.
- Confirm the instance name — the name chosen when the instance was installed;
SQLEXPRESSis the usual name on an Express install and is the example here. - Confirm the instance's current TCP port — the instance's TCP/IP network properties show a dynamic assignment as port 0, which can change at restart, and a fixed value once you assign one.
- Write the URL in the documented shape
jdbc:sqlserver://host\instanceName[:port], with the instance, the port, or both, as the worked example below shows. - Test the connection and keep the full error text, because the layer the error reports decides the fix.
Worked example, with example values throughout. Test server at 192.168.1.50, instance SQLEXPRESS, fixed TCP port 50123. The instance form jdbc:sqlserver://192.168.1.50\SQLEXPRESS sends the driver to the SQL Server Browser service on UDP 1434, which answers that SQLEXPRESS listens on 50123, and the connection opens there; the port form jdbc:sqlserver://192.168.1.50:50123 skips the lookup and opens the same socket directly, which is why a confirmed port makes the URL independent of the Browser service. Copying the production layout instead — a single default instance on TCP 1433 — produces jdbc:sqlserver://192.168.1.50:1433, and 1433 is not 50123, so that URL knocks on a door where SQLEXPRESS is not standing, no matter how perfectly the backslash is typed.
Which port belongs in the URL for a named instance? #
The instance's own port, not the production server's: a named instance takes a dynamic port assigned at startup unless you fix one, only one instance on a host can listen on TCP 1433, and the case here failed because the test instance's port differed from the production assumption.
Find the number on the server rather than in the old connection string. Assigning a fixed port to a named instance is documented, and it removes two fragilities at once: the lookup through the Browser service, and the possibility that a restart moves a dynamic port. With the port in the URL, the Browser lookup drops out of the connection path entirely; with only the instance name in the URL, the lookup stays part of the path, so a stopped Browser service or a blocked lookup port fails the connection exactly like a wrong port would. A timeout that comes from an instance-to-port mismatch — the driver waiting on a server that is not listening where the URL says — is worked through step by step in the article on connecting Ignition to a SQL Server Express named instance.
What if the URL is right and the connection still fails? #
Stop editing the URL and read the error: after host, instance and port are confirmed, the remaining failure in the resolved case was TLS version negotiation, cleared only when the network admin changed a TLS setting in the java.security file of the Java runtime that makes the connection. The backslash never mattered.
The JDBC driver and SQL Server negotiate a TLS version for the channel before any login or query runs. If the runtime's algorithm settings in its java.security file exclude a protocol the server demands, or the server refuses one the driver offers, the handshake dies and the error talks about SSL or protocol versions, not about names. In that case the network admin changed the file and the connection came up immediately; the record does not name the TLS version or the exact property changed, so read the handshake error you actually receive and align the runtime's protocol list with the versions the server accepts.
One caution for a plant network: the durable fix moves both ends to a version they can both accept — updating the Java runtime or the JDBC driver where needed — rather than re-enabling deprecated protocols just to make one handshake pass, and the algorithm list belongs to the network admin who owns the site's security baseline.
The same layering shows up outside JDBC: an ODBC SSL security error 08001 on an edge PC is likewise a handshake-layer fault that survives a perfectly good server name.
How do you tell a URL fault from a TLS fault? #
By the stage the error reports: unknown host, instance lookup failure or a connection timeout means the name-and-port layer, so recheck the URL values; a handshake, SSL or protocol error means the URL already parsed and the socket opened, so fix the TLS configuration instead.
Sort every failure into one of three layers before touching anything:
- Name and port: unknown host, instance not found, timeout or connection refused — check both halves of the address, confirm the Browser service is running when the URL carries no port, or switch to the port form.
- Handshake: SSL, protocol version or certificate complaints — the URL layer already succeeded, so the network admin aligns the java.security protocol list with what the server accepts.
- After the connection opens: login, query or data-type errors are a different layer entirely — JDBC date conversion problems in Ignition, for example, have their own documented cause and fix.
The decision for each case, then: type the backslash literally, because it is the instance separator and needs no escape; point the URL at the test instance's confirmed port instead of the production port; and when host, instance and port all check out and the error still names SSL or a protocol, change the TLS settings in the java.security file of the runtime making the connection — the URL text itself was never in question.
Questions asked
Can I put the SQL Server instance name in the URL without a backslash?
Yes. The documented form also takes the instance as a connection property after the address, in the shape jdbc:sqlserver://192.168.1.50;instanceName=SQLEXPRESS, and other settings such as encrypt=true ride along the same way. The property form and the backslash form identify the same instance, so use whichever your connection editor accepts and keep the instance name exactly as installed.
Does the SQL Server Browser service have to run for a named-instance URL?
Yes, when the URL gives an instance name without a port: the driver resolves the name by asking the SQL Server Browser service on UDP 1434. If that service is stopped or the lookup port is blocked between the PC and the server, the connection fails; assign a fixed port to the instance and put that port in the URL instead.
Why did a java.security TLS fix on one machine not fix the other?
Each Java runtime reads its own java.security file, and plant-floor software commonly runs its own bundled runtime. A change to the file belonging to one installation leaves the other installation's TLS algorithm list untouched, so apply the reviewed change to the runtime that the failing database connection actually starts with, then retest.
Should the test database connection reuse the production URL settings?
No, unless both servers have the same topology. The resolved case failed on exactly this: production ran a single default instance on its standard port, while the test server needed the named-instance convention and its own port. Confirm the test instance's name and port on that server, and write the URL from those values.


