Created
May 24, 2013 19:39
-
-
Save jpoetker/5645991 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try (Connection con = DriverManager.getConnection(JDBC_URL, USER, PASSWORD)) { | |
try (PreparedStatement query = con.prepareStatement(SQL_SELECT)) { | |
query.setInt(1, Integer.valueOf(value)); | |
try (ResultSet rs = query.executeQuery()) { | |
while (rs.next()) { | |
System.out.println(rs.getString(1)); | |
} | |
} | |
} | |
} catch (SQLException e) { | |
throw new RuntimeException(e); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment