We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// NullPointerException @Test public void testPrepareStatementQuery() throws SQLException { String sql = "SELECT number from numbers(100) where number = ?"; try(PreparedStatement statement = conn.prepareStatement(sql)) { statement.setInt(1, 1); ResultSet r = statement.executeQuery(); r.next(); Assertions.assertEquals(1, r.getLong("number")); } } // NullPointerException @Test public void testPrepareStatementExecute() throws SQLException { String sql = "SELECT number from numbers(100) where number = ?"; try(PreparedStatement statement = conn.prepareStatement(sql)) { statement.setInt(1, 1); statement.execute(); ResultSet r = statement.getResultSet(); r.next(); Assertions.assertEquals(1, r.getLong("number")); } } // Not execute @Test public void testPrepareStatementExecuteUpdate() throws SQLException { String sql = "insert into ta values (?)"; try(PreparedStatement statement = conn.prepareStatement(sql)) { statement.setInt(1, ThreadLocalRandom.current().nextInt(1, 10)); int result = statement.executeUpdate(); Assertions.assertEquals(1, result); } }
These method implementations should follow the PreparedStatement interface definition.
The text was updated successfully, but these errors were encountered:
Hi @codering , thanks for your issue! I will look into it.
Sorry, something went wrong.
hantmac
Successfully merging a pull request may close this issue.
These method implementations should follow the PreparedStatement interface definition.
The text was updated successfully, but these errors were encountered: