java.sql.DriverManager.getConnection method java.sql.DriverManager.getConnection method

A Java application using the JDBC API establishes a connection to a database by obtaining a Connection object. The standard way to obtain a Connection object is to call the method DriverManager.getConnection, which takes a String containing a database connection URL. A JDBC database connection URL (uniform resource locator) provides a way of identifying a database.

DriverManager.getConnection can take one argument besides a database connection URL, a Properties object. You can use the Properties object to set database connection URL attributes.

SchemasAPP as defaultYou can also supply strings representing user names and passwords. When they are supplied, checks whether they are valid for the current system if user authentication is enabled. User names are passed to as authorization identifiers, which are used to determine whether the user is authorized for access to the database and for determining the default schema. When the connection is established, if no user is supplied, sets the default user to APP, which uses to name the default schema. If a user is supplied, the default schema is the same as the user name.