Skip to content

Instantly share code, notes, and snippets.

@luxiaochen0
Created June 3, 2020 17:10
Show Gist options
  • Select an option

  • Save luxiaochen0/013b570f547c4e0459b8e5a0a52501e5 to your computer and use it in GitHub Desktop.

Select an option

Save luxiaochen0/013b570f547c4e0459b8e5a0a52501e5 to your computer and use it in GitHub Desktop.
Connection con=DriverManager.getConnection("jdbc:mysql://192.168.99.101:3306/lshop?useUnicode=true&characterEncoding=UTF-8","root","123456");
Statement stmt=con.createStatement();
ResultSet rs =stmt.executeQuery("select * from goods");
while (rs.next()){
System.out.println(rs.getInt(1));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment