Results 1 to 3 of 3

Thread: JDBC driver and datasource

  1. #1
    Junior Member
    Join Date
    Sep 2007
    Answers
    8

    JDBC driver and datasource

    JDBC-Implementation of Connection,Resultset,Statement

    In JDBC We use Connection,Resultset,Statement..etc.
    All these are interfaces, but we are using it..
    My Question is:
    1.Where is the implementation of these interfaces?
    2. We will load the JDBC driver in the first step.. Instead can we put the driver class in class path? Why loading class using Class.forName()
    3.What is the difference between using JDBC driver and datasource?

    Thanks in advance.


  2. #2
    Junior Member
    Join Date
    Dec 2007
    Answers
    3

    Re: JDBC driver and datasource

    JDBC driver is used to communicate the data to and fro. DataSource is an entry point in the database where we will enter into database and schemas.


  3. #3
    Junior Member
    Join Date
    Jul 2007
    Answers
    12

    Re: JDBC driver and datasource

    Java DataBase Connectivity API provides only interfaces so that using JDBC in your application will be independent of different types of Databases like Oracle, MySQL etc. And the database vendor like Oracle etc. provides the implementation of these interfaces specific to their product.

    When you are running ur application you will provide some .jar or .zip files namely ojdbc14.jar etc. in your classpath. These jar/zip s are nothing but the classes(Vendor specific) which provides the implementation JDBC API.

    If u can observe, when u want to create a statement object, u will call createStatement() method on Connection object. These methods are factory methods which contains the implementation of Statement interface.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact