Ho scaricato sqljdbc.jar, poi ho installato MS SQLSERVER Express 2005.

import java.sql.*;

public class connectURL {

public static void main(String[] args) {

// Create a variable for the connection string.
String connectionUrl = "jdbc:sqlserver://localhost:1433;" +
"databaseName=prova;user=[BOH];password=[BOH];

// Declare the JDBC objects.
Connection con = null;
Statement stmt = null;
ResultSet rs = null;

try {
// Establish the connection.
Class.forName("com.microsoft.sqlserver.jdbc.SQLSer verDriver");
con = DriverManager.getConnection(connectionUrl);
}
}

// Handle any errors that may have occurred.
catch (Exception e) {
e.printStackTrace();
}

finally {
if (rs != null) try { rs.close(); } catch(Exception e) {}
if (stmt != null) try { stmt.close(); } catch(Exception e) {}
if (con != null) try { con.close(); } catch(Exception e) {}
}
}
}


Ma non ho chiaro come autenticarmi...