View RSS Feed

Java Database

Establishing a Connection

Rate this Entry
by , 03-10-2012 at 07:44 AM (659 Views)
The very 1st step to use data source is to make connection with data source. Data source could be:
  • Legacy file system
  • DBMS
  • Few other data sources, with a corresponding JDBC driver


For connecting an application to data source, these 2 classes are used.

  • DriverManager: Complete implementation is provided by this class so that to make a connection b/w application and a data source, that is specified by URL of database. JDBC drivers are automatically loaded by this class.
  • DataSource: This is a preferred approach to connect with the data source as it hides the data soruce. A DataSource objectís properties are set so that it represents a particular data source. This is one of the best approaches to make connection with data source as data source is made hidden by it.

Submit "Establishing a Connection" to Facebook Submit "Establishing a Connection" to Digg Submit "Establishing a Connection" to del.icio.us Submit "Establishing a Connection" to StumbleUpon Submit "Establishing a Connection" to Google

Categories
JDBC

Comments