How to Interact with DB?

Generally every DB vendor provides a User Interface through which we can easily execute SQL query’s and get the result . And these tools will help DB developers to create database. But as a programmer we want to interact with the DB dynamically to execute some SQL queries from our application (Any application like C, C++, JAVA etc), and for this requirement DB vendors provide some Native Libraries (Vendor Specific) using this we can interact with the DB i.e. If you want to execute some queries on Oracle DB, oracle vendor provides an OCI (Oracle Call Interface) Libraries to perform the same.

What is ODBC ?

ODBC (Open Database Connectivity) is an ISV (Independent software vendor product) composes of native API to connect to different databases through via a single API called ODBC.

Open Database Connectivity (ODBC) is an SQL oriented application programming interface developed by in collaboration with IBM and some other database vendors.

ODBC comes with Microsoft products and with all databases on Windows OS.

DataSource interface is implemented by driver vendor. There are 3 types of implementations available:

  1. Basic Implementation- Produces a standard connection object.
  2. Connection Pooling Implementation- Produces a connection object that automatically participates in connection pooling. This implementation works with a middle-tier connection pooling manager.
  3. Distributed transaction implementation- Produces a connection object that may be used for distributed transactions and almost always participates in connection pooling. This implementation works with a middle-tier transaction manager and almost always with a connection pool manager.

A driver that is accessed via a DataSource object does not register itself with the DriverManager. Rather, a DataSource object is retrieved though a lookup operation and then used to create a Connection object. With a basic implementation, the connection obtained through a DataSource object is identical to a connection obtained through the DriverManager facility.

Method Index

  • Connection getConnection() – This function returns Connection object on demand of this method.
  • Connection getConnection(String user, String pass) – This function returns Connection object on demand of this method by passing username and password.
RELATED POST

TABLE CONTROLS IN DOT NET
WEB CONTROLS IN ASP.NET

You can go through the complete ASP.NET COURSE PART ONE AND TWO HERE.




To Do Next: Thank you for visiting PROGRAMMING BLOG. If you liked the post, please subscribe to my blog via email or RSS FEED.You can contact me here for any specific feed back .

0 comments

Post a Comment