Skip to content

AWS Glue SQL Server JDBC error

0

I am setting up JDBC connections in AWS Glue to some on-prem SQL Servers. I am able to successfully connect to a server and a handful of the databases on the server. The issue I am having is when the database name has a special character in it. So, let say it's database-name. I can successfully connect to a database called databasename, but it give me a failure message when I have a hyphen in the name. Also, if I am trying to connect to a named instance of SQL Server, I am also getting an error. So if my server is 10.10.10.10\instancename, I am getting an error. How should the connection strings be formatted to be able to connect successfully?

Thanks

asked 2 years ago355 views

1 Answer
-1

When setting up JDBC connections in AWS Glue to SQL Server databases with special characters in their names or to named instances, you need to adjust your connection string format to handle these cases correctly.

For databases with special characters like hyphens: You should enclose the database name in square brackets. For example, instead of using: jdbc:sqlserver://10.10.10.10:1433;databaseName=database-name

Use: jdbc:sqlserver://10.10.10.10:1433;databaseName=[database-name]

For connecting to named instances: When connecting to a named instance, you need to use a slightly different format. Instead of using a backslash () to separate the server name and instance name, use a backslash and then another backslash (\). For example:

jdbc:sqlserver://10.10.10.10\instancename:1433;databaseName=yourdatabase

If you're combining both scenarios (named instance and database with special characters): jdbc:sqlserver://10.10.10.10\instancename:1433;databaseName=[database-name]

Remember to ensure that your security groups, network settings, and IAM permissions are correctly configured to allow the connection. Also, make sure you're using a compatible JDBC driver version for your SQL Server version.

If you continue to experience issues, you may want to review the CloudWatch logs for your Glue job for more detailed error messages or consider using the AWS Systems Manager AWSSupport-TroubleshootGlueConnection runbook to help identify and resolve common connection issues.
Sources
AWS Glue Connection to RDS SQL Server Fails – "Failed status due to failed connection" | AWS re:Post
Troublehsoot AWS Glue connection to a JDBC data source | AWS re:Post
JDBC connections - AWS Glue

answered 2 years ago

  • The double backslash between the server name and instance name does not work.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.