如果尝试连接使用Windows身份验证的数据库,则可以在连接字符串中使用“ integratedSecurity”选项。
DriverManager.getConnection("jdbc:sqlserver://localhost:1433;databaseName=SocialFamilyTree;integratedSecurity=true;");
如果尝试连接使用Windows身份验证的数据库,则可以在连接字符串中使用“ integratedSecurity”选项。
DriverManager.getConnection("jdbc:sqlserver://localhost:1433;databaseName=SocialFamilyTree;integratedSecurity=true;");