The Connection class contains methods that control the connection to a database.

The Connection class defines the following methods.

Method

Returns

Description

close():Object

Object

Releases the database and JDBC resources for a Connection object.

createStatement():Object

Object

Creates a Statement object for sending SQL statements to the database.

prepareCall(string):PreparedStatement

PreparedStatement

Creates a CallableStatement object for calling database stored procedures.

prepareStatement(string):PreparedStatement

PreparedStatement

Creates a PreparedStatement object for sending parameterized SQL statements to the database.