Last active
August 20, 2017 07:17
-
-
Save ps06756/a5860717feff7f60d14fbff515d33923 to your computer and use it in GitHub Desktop.
This file contains 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 connection = dataSource.getConnection(); ){ | |
try( PreparedStatement pstmt = connection.prepareStatement("SELECT studentName from student where studentId = 1"); ) { | |
try( ResultSet resultSet = pstmt.executeQuery(); ) { | |
while (resultSet.next()) { | |
System.out.println(resultSet.getString(1)); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment