You're asking why the connection to the principal server fails, right?
I'd start with taking a look at the connection string. Is it correct and in the right format? Unfortunately my Java is too rusty to be able to spot any problems.
EDIT: maybe you need to specify a machine name before the database instance name? I.e.
String connectionUrl = "jdbc:sqlserver://MyDBServer\SQLEXPRESS:1433;" +
"databaseName=SchPlan;integratedSecurity=true;" ;
See
Building the Connection URL[
^]
Secondly, have a look at what the SQLException you're getting is telling you. Add a
System.out.println
statement into the catch block for the SQL exception, and print its contents.
Thirdly, make sure the principal server is actually running :)