juzhengw
I just did this last year,I will post my link code for you try { Class.forName(“com.microsoft.sqlserver.jdbc.SQLServerDriver”); //Load the sqlserver JDBC driver //Class .forName(“org.gjt.mm.mysql.Driver”); System.out.println(“Success loading sqlserver Driver!”); catch (Exception e) { System.out.print(“Error loading sqlserver Driver!”) “); e.printStackTrace(); } try { Connection connect = DriverManager.getConnection( “jdbc:sqlserver://localhost:1433;DataBasename=java”,”sa”,”***** **”); //Don’t worry about the address ,The user name is sa //The connection URL is jdbc:sqlserver//server address/database name , The next two parameters are the login username and password System. out.println(“Success connect sqlserver server!”); Statement stmt = connect.createStatement(); ResultSet rs = stmt.executeQuery(“select * from Users”); //user is for you Name: If you are sure that your jadc package and link code are completely correct, I guess you may have the database not set to use password login (the table is not in the database for password login). There is no specific code and it is hard to say,Thrown What’s wrong?,I only used this two or two years ago,I’m quite familiar with it,If you still can’t solve it, you can send me a private message;Xiaobai mutual encouragement