Skip to content

Commit

Permalink
Update Connect.java
Browse files Browse the repository at this point in the history
  • Loading branch information
zukahai committed Dec 24, 2021
1 parent 3cf281a commit 951be2b
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions Connect.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@ public static void main(String[] args) {
Class.forName ("com.mysql.cj.jdbc.Driver");
conn = DriverManager.getConnection(url, userName, password);
System.out.println("Ok");

String sql = "SELECT * FROM student";
PreparedStatement stm= conn.prepareStatement(sql);
stm = conn.prepareStatement(sql);
ResultSet rs = stm.executeQuery();
while(rs.next()) {
System.out.println(rs.getString(1) + "\t" + rs.getString(2) + "\t\t" + rs.getInt(3));
}

} catch(Exception e){
System.out.println(e.getMessage());
}
Expand Down

0 comments on commit 951be2b

Please sign in to comment.