Changes

Jump to: navigation, search

PostgreSQL Adapter Project - Resources

4 bytes removed, 15:25, 22 November 2010
JDBC
:Once you have registered the Driver class, you need to request a connection to a PostgreSQL database. To do this, you use a class called DriverManager. The DriverManager class is responsible for handling JDBC URLs, finding an appropriate driver, and then using that driver to provide a connection to the database.
:JDBC URLs are of the following format, in three colon-delimited parts:
<code>jdbc:[drivertype]:[database]</code>
:The first part, jdbc, is a constant. It represents that you are connecting to a JDBC data source. The second part, [drivertype], represents the kind of database you want to connect to. Use postgresql to connect to a PostgreSQL database. The third part is passed off to the driver, which finds the actual database. It takes on one of the following formats:
<code> databasename --- //hostname/databasename ------ //hostname:portnumber/databasename</code>
1
edit

Navigation menu