JDBC连接数据库的问题
import java.sql.*;
public class ConnectionDatabaseDemo
{
public ConnectionDatabaseDemo()
{
try
{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
String url = "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName = JAVA ";
String userName = "sa";
String password = "";
Connection con = DriverManager.getConnection(url,userName,password);
}
catch(SQLException e)
{
e.printStackTrace();
}
catch(ClassNotFoundException ex)
{
ex.printStackTrace();
}
}
public static void main(String[] args)
{
new ConnectionDatabaseDemo();
}
}
我的这个又错在哪里了`