I have an application using JTDS to connect to SQL Server. I need to change the database and want to test the connection string first before reconfiguring the application. I'm a SQL Server DBA, not a Java developer!
Here's my test code:

```
// Import the SQL Server JDBC Driver classes 
import java.sql.*; 
class Example 
{  
   public static void main(String args[]) 
   {  
   try  
   { 
        // Build the connection string, and get a connection 
        System.out.println("1."); 
        System.out.println("2."); 
        String connectionUrl = "jdbc:jtds:sqlserver://UK-SB-Server:53569;DatabaseName=helpdesk;user=helpdesk;password=MyPwd;Tds=8.0;PrepareSql=3;XaEmulation=false";
        System.out.println("3."); 
        Connection con = DriverManager.getConnection(connectionUrl); 
        System.out.println("Connected."); 

        // Create and execute an SQL statement that returns some data.  
        String SQL = "SELECT * from dbo.AllowedValues";  
        Statement stmt = con.createStatement();  
        ResultSet rs = stmt.executeQuery(SQL); 

        // Iterate through the data in the result set and display it.  
        while (rs.next())  
        {  
           System.out.println(rs.getString(1) + " " + rs.getString(2));  
        } 
   }  
   catch(Exception e)  
   { 
        System.out.println("Error - " + e.getMessage()); 
        System.exit(0);  
   } 
} 
}

```

I compile it with:

```
C:\Progra~1\Java\jdk1.6.0_45\bin\javac C:\JavaTest\example.java

```

I run it with:

```
C:\Progra~1\Java\jdk1.6.0_45\bin\java -classpath C:\JavaTest Example

```

jtds-1.2.jar and Example.class are both in C:\JavaTest

I get the following error:

```
1.
2.
3.
Error - No suitable driver found for jdbc:jtds:sqlserver://UK-SB-Server:53569;DatabaseName=helpdesk;user=helpdesk;password=MyPwd;Tds=8.0;PrepareSql=3;XaEmulation=false

```

I've read conflicting posts as to whether I need 

```
Class.forName("net.sourceforge.jtds.jdbc.Driver");

```

or not. If I put the line between `println("1.")` and `println("2.")`, it just fails earlier with 

```
1.
Error - net.sourceforge.jtds.jdbc.Driver

```

I may be missing something obvious, but please help me resolve this issue.