Using the EDB JDBC Connector with Java applications v42.7.3.1
With Java and the EDB JDBC Connector in place, a Java application can access an EDB Postgres Advanced Server database. This example creates an application that executes a query and prints the result set.
This example is simple, but it shows the fundamental steps required to interact with an EDB Postgres Advanced Server database from a Java application:
- Load the JDBC driver.
- Build connection properties.
- Connect to the database server.
- Execute a SQL statement.
- Process the result set.
- Clean up.
- Handle any errors that occur.
loading_the_advanced_server_jdbc_connector connecting_to_the_database executing_sql_statements_through_statement_objects retrieving_results_from_a_resultset_object freeing_resources handling_errors