为什么说 驱动加载失败
我蒙了 大家帮帮
import java.sql.*;
import java.io.*;
public class TextJdbc
{
public static void main(String []argv)
{
String user="lovenong";
String pass="";
String url="jdbc:Microsoft:sqlserver://hostname:1433;Databasename=mydatabase";
String driver= "com.Microsoft.jdbc.sqlserver.SQLServerDriver";
String tableName="student";
String sqlstr;
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
try
{
Class.forName(driver);
con= DriverManager.getConnection(url,user,pass);
stmt = con.createStatement();
//插入信息
sqlstr="insert into "+tableName+" valus('01234','张发禹',21)";
stmt.executeUpdate(sqlstr);
}
catch(ClassNotFoundException e)
{
System.out.println(e.toString());
}
catch(SQLException e1)
{
System.out.println(e1.toString());
}
finally
{
try
{
if(rs!=null)
rs.close();
if(stmt!=null)
stmt.close();
if(con!=null)
con.close();
}
catch(SQLException e2)
{
System.out.println(e2.toString());
}
}
}
}
[求助]java连接SQLserver