Advertisement
Guest User

Untitled

a guest
Aug 16th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. public static void main(String[] args) throws SQLException {
  2. try (Connection c = DriverManager.getConnection("jdbc:postgresql://localhost/webtester", "webtester", "password")) {
  3. Statement st = c.createStatement();
  4. ResultSet rs = st.executeQuery("select * from account");
  5. while (rs.next()) {
  6. System.out.println(rs.getString(2));
  7. }
  8. }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement