标签:连接 try address stack test name exec localhost .exe
导入JDBC
import java.sql.SQLException;
public class text {
public static void main(){
Connection conn;
Statement stmt;
ResultSet rs;
String url = "jdbc:sqlserver://localhost:1433;DatabaseName=我的数据库;";
String sql = "select * from address_list where "+s2+"=(‘"+s1+"‘)";
try {
conn = DriverManager.getConnection(url, "sa", "123456");
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
conn.close();
rs.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
标签:连接 try address stack test name exec localhost .exe
原文地址:https://www.cnblogs.com/dahaihaohan/p/9201306.html