我的代码是:
try{
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
Connection con=DriverManager.getConnection("jdbc:sqlserver://localhost;jithin-pc:1433;databaseName=news;IntegratedSecurity=true");
String qr="SELECT * FROM base";
Statement st=con.createStatement();
ResultSet rs=st.executeQuery(qr);
rs.next();
System.out.println(rs.getString(1));
out.println(rs.getString(1));
}
catch(Exception e)
{
System.out.println(e);
out.println(e);
}
我收到如下错误:
com.microsoft.sqlserver.jdbc.SQLServerException: The connection string contains a badly formed name or value.
我尝试更改 sql 设置防火墙等。请提供任何建议