My TCP ports are open. I think it's something wrong with my connectionn string. I think i have been looking at it too long and now i am blind.
public static ResultSet getNames(String name){
PreparedStatement stat;
ResultSet names;
try {
RowSetFactory fact = RowSetProvider.newFactory();
CachedRowSet crs= fact.createCachedRowSet();
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
try (Connection conn = DriverManager.getConnection("jdbc:sqlserver://localhost:1433;encrypt=true;integratedSecurity=true;databaseName=Northwind;")) {
stat = conn.prepareStatement(name);
names = stat.executeQuery();
crs.populate(names);
System.out.print("Connection successful.");
conn.close();
return crs;
}
} catch (SQLException | ClassNotFoundException ex) {
Logger.getLogger(DatabaseSchema.class.getName()).log(Level.SEVERE, null, ex);
System.out.print("Connection failed.");
return null;
}
}