Java基础进阶案例教程(课件)例9-5.docxVIP

  • 5
  • 0
  • 约小于1千字
  • 约 3页
  • 2018-12-28 发布于江西
  • 举报
程序代码如下。 import java.sql.*; import java.util.Scanner; public class Example9_5 { public static void main(String[] args) { String user=root; String password=1234; String url=jdbc:mysql://localhost:3306/xsgl; try { Connection conn=DriverManager.getConnection(url, user, password); try { Scanner in=new Scanner(System.in); System.out.println(请输入用户名和密码); System.out.println(请输入用户名:); user=in.nextLine(); System.out.println(请输入用户密码::); password=in.nextLine(); String sql=String.format(select * from U where name=%s and password=%s,user,password); Statement stmt=

文档评论(0)

1亿VIP精品文档

相关文档