????import java.sql.Connection;
????import java.sql.DriverManager;
????import java.sql.ResultSet;
????import java.sql.SQLException;
????import java.sql.Statement;
????//????IDE?????eclipse
????//????SQL server????????????SQL server??????jar??????????·?? sqljdbc4.jar.
???????????£?
????1???????????? sqljdbc4.jar????jar??
????2??????jar????????????????????????????jar??
????3?????jar???????Build Path->Add to Build Path
????public class TestSQL {
????public static void main(String args[]) throws ClassNotFoundException?? SQLException{
????String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";  //????sql server????·??
????String dbURL = "jdbc:sqlserver://localhost; DatabaseName=TestSQL"; //localhost??????????????? SQL server?????
????//???????????????????????????????
????String user = "sa"; //?????????????? 
????String pwd = "1234";//?????????????
????Connection dbConn;//????????
????Class.forName(driverName);//????????
????dbConn = DriverManager.getConnection(dbURL??user?? pwd);//???????
????Statement sta = dbConn.createStatement();   //???sql????????
????String str = "insert into Info values('?????'??'100')";//????SQL server???
????sta.executeUpdate(str);//???SQL server???
????sta.close();//???????
????dbConn.close();//???????
????}
????}
??????????eclipse??Java????sql server??????????????????????????? SQL Server????????.