关于加载SQL server数据库驱动

图片说明
图片说明
图片说明
我下载的是SQL server2008,然后创建了一个数据库hospital,穿件了一张表,然后我在网上下载了一个jar包加到bin目录下面了,然后在eclipse里面用java程序链接数据可是加载失败,这是为什么啊

SQL Server 2008
相应改下用户名,密码,数据库名

 public static Connection getConnection(){
    String url="jdbc:sqlserver://localhost:1433;DataBeseName=flower";
    String user="Flowershop";
    String pwd="Flowershop";
    Connection conn=null;
    try{
    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
    }catch(ClassNotFoundException e){
    System.out.println(e);
    }
    try{
     conn=DriverManager.getConnection(url,user,pwd);
     }catch(SQLException e){
     System.out.println(e);
     }
     return conn;
     }
public boolean  executesql(String sql){
     Connection conn=getConnection();
     boolean flag=false;
     Statement stmt=null;
     try{
     stmt=conn.createStatement();
     stmt.executeUpdate(sql);
     flag=true;
     }catch(Exception e)
     {
        e.printStackTrace();
    }finally{
        close(stmt,conn);
        }
        return flag;
        }
//构造器,每实例化一次调用一次
public ProjectMessageDao() {
    try {
        Class.forName("com.mysql.jdbc.Driver"); // 加载驱动
        con = DriverManager.getConnection(url, name, pasd); // 获取数据库连接对象
    } catch (ClassNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (SQLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}


jar放入webroot下的web-inf下的lib里  然后右键Build path        ----  add to Build path

图片说明
这是啥问题呢

用户名sa不能登录,,你自己用客户端sa登录下

图片说明
这里的语句少些了吧!
eg:
Class.forName("com.mysql.jdbc.Driver");
String url1="jdbc:mysql://localhost:3306/buses";
String url2="?user=root&password=123456";
String url3="&useUnicode=true&characterEncoding=GB2312";
String url=url1+url2+url3;
Connection conn=DriverManager.getConnection(url);
你应该是没有写url什么的吧!