April 2018
Intermediate to advanced
202 pages
4h 48m
English
A Statement object is used to invoke SQL statements in the database. The following snippet of code shows how to retrieve a Connection object from the connection pool. This object is used to create a new Statement, which, in turn, is used to execute an SQL statement:
try (Connection connection = pool.getConnection()) { Statement statement = connection.createStatement(); ResultSet resultSet = statement.execute("SELECT content FROM messages");}
Read now
Unlock full access