用的是window身份验证
用eclipse连接sql server2008能够成功
在myeclipse新建一个类连接sql server2008也能成功
但是用Tomcat启动myeclipse的jsp页面就出现以下错误
com.microsoft.sqlserver.jdbc.SQLServerException: 没有为集成身份验证配置驱动程序。
已经 sqljdbc4.jar放在Tomcat的lib目录下,myeclipse的lib目录下
<% PreparedStatement ps=null;
Connection ct=null;
ResultSet rs=null;
try{System.out.println("1");
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
System.out.println("2");
ct=DriverManager.getConnection("jdbc:sqlserver://localhost:8888;databasename=student;integratedSecurity=true;"); ps=ct.prepareStatement("select sname from mystudent");
rs=ps.executeQuery();
while(rs.next()){
String a=rs.getString(1);
System.out.println(a);
System.out.println("fsdf"); }
}catch(Exception ee){
ee.printStackTrace();
}
%>
跪求高手解答,现在都想崩溃了,都不知道哪里有问题
用eclipse连接sql server2008能够成功
在myeclipse新建一个类连接sql server2008也能成功
但是用Tomcat启动myeclipse的jsp页面就出现以下错误
com.microsoft.sqlserver.jdbc.SQLServerException: 没有为集成身份验证配置驱动程序。
已经 sqljdbc4.jar放在Tomcat的lib目录下,myeclipse的lib目录下
<% PreparedStatement ps=null;
Connection ct=null;
ResultSet rs=null;
try{System.out.println("1");
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
System.out.println("2");
ct=DriverManager.getConnection("jdbc:sqlserver://localhost:8888;databasename=student;integratedSecurity=true;"); ps=ct.prepareStatement("select sname from mystudent");
rs=ps.executeQuery();
while(rs.next()){
String a=rs.getString(1);
System.out.println(a);
System.out.println("fsdf"); }
}catch(Exception ee){
ee.printStackTrace();
}
%>
跪求高手解答,现在都想崩溃了,都不知道哪里有问题
myeclipse不喜欢SQL server我觉得有道理;
不信你自己去连接Access,oracle,mysql很容易就会连接成成功;总之,这个驱动版本要找对
不好找呢
我用的是window身份验证,不用账号密码的
myeclipse不喜欢SQL server我觉得有道理;
不信你自己去连接Access,oracle,mysql很容易就会连接成成功;总之,这个驱动版本要找对
不好找呢
这驱动应该没问题的,用myeclipse新建一个类可以访问到