// This module is included in the following assemblies:
// as_connecting-to-databases.adoc

[id='create-database-connection_{context}']
= Creating a database connection

You create a separate connection for each database that you want to 
connect to in an integration. You can use the same connection in 
multiple integrations. 

A database connection operates on a database table that you specify or
invokes a stored procedure that you specify. 

.Prerequisite
The database table or the stored procedure must exist when an integration
connects to the database. 

.Procedure

. Ensure that the JDBC driver for the database that you want to connect to
is on your classpath. If you uploaded a JDBC driver library extension to 
connect to a proprietary database, then the upload process puts the driver
on your classpath. See 
link:{LinkSyndesisIntegrationGuide}#creating-jdbc-driver-library-extensions_extensions[Creating JDBC driver library extensions]. 
. In {prodname}, in the left panel, click *Connections* to
display any available connections.
. Click *Create Connection* to display
{prodname} connectors.
. Click the *Database* connector.
. Configure the connection by entering:
+
.. In the *Connection URL* field, enter the JDBC URL for the database that you want
to connect to. For example, enter `*jdbc:postgresql://ignite-db1234/sampledb*`.
.. In the *Username* field, enter the name of the account that you want to use
to access the database. Ensure that the specified password and user name
are for the same account.
.. In the *Password* field, enter the password associated with the
user account you want to use to access the database.
.. In the *Schema* field, enter the name of the schema for the database.
How you specify the database schema varies for each type of database. 
Details are in the next section: 
link:{LinkSyndesisConnectorGuide}#how-to-specify-the-schema-in-a-database-connection_db[How to specify the schema in a database connection].

. Click *Validate*. {prodname} tries to validate the
connection and displays a message that indicates whether
validation is successful. If validation fails, revise the configuration
details as needed and try again.
. If validation is successful, click *Next*.
. In the *Name* field, enter your choice of a name that
helps you distinguish this connection from any other connections.
For example, enter `*PostgreSQL DB 1*`.
. In the *Description* field, optionally enter any information that
is helpful to know about this connection. For example,
enter `*Sample PostgreSQL connection
that uses my login credentials.*`
. Click *Save* to see that the connection you
created is now available. If you entered the example name, you would
see that *PostgreSQL DB 1* appears as a connection that you can 
choose to add to an integration.
