A very quick and easy thing you can do to help yourself and your DBA is to use the Application Name parameter on the JDBC driver wisely.

Your JDBC connection string might look something like this.

[java]
jdbc:sqlserver://sscdb.sscorp.com:1433;User=xxxx;Password=xxxx;
[/java]

There’s an optional parameter on the connection string called Application Name. You just add it to the connection string like this.

[java]
jdbc:sqlserver://sscdb.sscorp.com:1433;User=xxxx;Password=xxxx;applicationName=OrderEntry;
[/java]

Now when you use the Activity Monitor from SQL Server Management Studio, you’ll see the application name:

SQL Server Activity Monitor Showing Some Application Names

SQL Server Activity Monitor Showing Some Application Names

If you don’t specify an application name, you’ll just see the default string Microsoft SQL Server JDBC Driver (if you’re using the Microsoft driver) for every JDBC app, which is not very helpful when you’re trying to figure out which application is tying up your database resources.

This is a very simple tip, easy to do, but it is often overlooked.

Hope this is helpful!

Leave a Reply

Your email address will not be published. Required fields are marked *

 characters available