连接mssql2005

	private static void connect2005() {
		try {
			Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
			Connection conn = DriverManager.getConnection(
					"jdbc:sqlserver://192.168.6.1:1433;databasename=huadu",
					"sa", "sa");

			System.out.println("conn=" + conn);
		} catch (Exception ex) {
			System.err.println(ex.getMessage());
		}
	}

你可能感兴趣的:(jdbc,Microsoft)