ODBC or Open Database Connectivity is an open standard application programming interface used for accessing hetrogenous datasources.
Imagine you have written several PHP programs which makes a connection to an Oracle database. For some reason now you have decided to use MYSQL instead of Oracle. Supposing you have used a proprietary connection to Oracle, then it would take a lot of coding effort to modify each of the PHP programs to make it connect to MYSQL as it already has connect strings to Oracle.
Now ODBC provides seamless open database connectivity using simple APIs to a variety of data sources such as MYSQL, MS-ACCESS, MSSQL, Oracle etc.,One has to create a ODBC connection for the specific datasource. This can be done using the ODBC dialog box which is accessible from the control panel. One requires a ODBC driver to be installed via Dynamic Link Libraries. There are three types of DSNs (Data Source Names), namely User DSN, System DSN and File DSN.
After ensuring that the driver required to connect to a data source is present one needs to add the data source by manually adding a data source from the ODBC dialog box in the control panel. After adding a database one has to configure it. The method to configure a database varies from one database to another. For example it is different for Oracle than MS-ACCESS as Oracle has a layer of TNS (Transparent Network Substrate). In the case of Oracle the TNS service name is mandatory to create a ODBC connection between client and server. In the case of Microsoft Access one has to just specify the network location of the access database and the name of the database. The ODBC manager accessible from the control panel will take care of all these issues while attempting to create a DSN name.
Here is an example of a PHP program connecting to a MYSQL database via a DSN named as "TestDSN".
$conn=odbc_connect('TestDSN','','');
$sql="SELECT * FROM Employee";
$cursor =odbc_exec($conn,$sql)
One may also connect a PHP program to a database using a DSNLESS connection. The disadvantage of using a DSN based connect string in a server - client system is that one requires to configure the DSN or multiple DSNs being used in the server side scripts( such as PHP) on client computers that or multiple client computers. This is because when a client computer encounters an ODBC string in a PHP program the DSN string has to be configured in the local client. This may not be possible to do when there are a lot of users using such programs. In such cases one uses DSN Less connections where the server's IP address /database name, user id and password are directly mentioned in the connect string.
By Srinivasa Gopal
Article Source: Open Database Connectivity
Article Copyright A pen that copies words that are meaningful to life, so that if words become many will be contained into a meaning of one word it is all cheers of everyone
Pages
- Denkafa Affiliate
- Omnipotent
- Taun17
- Revisi Blogging
- Article Copyright
- Privacy
- Disclaimer
- Terms Of Service
- Sitemap
- Ketentuan Layanan Penerbit Article Copyright
- Ketentuan Layanan Article Copyright
- Ketentuan layanan untuk penulis
- Room Comment Article Copyright
- Tiktok
- MineShiba
- MineWIN
- MineDoge
- MineBTTC
- MineSIA
- MineTRON
- MineEXEC
- CryptoSense
- FoucetPay
- Coinpayz
- Dunia Aneh Blog 89
- Collections Article
- Coriarti
- Pusing Blogger
Open Database Connectivity
Label:
Article Copyright,
Canada,
Daily Devotional,
Israel,
Japan,
Malaysia,
Rusia,
Saudi Arabia,
United States
Subscribe to:
Post Comments (Atom)
India and Malaysia recently faced off in a friendly match
India and Malaysia recently faced off in a friendly match, showcasing the talent and skills of both teams. The game was highly anticipated a...
-
Greater Noida West, better known as Noida Extension, is emerging as a realty hotspot for residential properties in National Capital Region ...
-
Studi mengidentifikasi hubungan potensial antara bakteri oral dan abses otak Bakteri yang diketahui menyebabkan infeksi mulut juga dapat me...
-
By Ronak Patel Angular was first termed in the year of 2009 through the group of developers in the way of introducing a brand new conc...
-
My executive coaching client, Sonya, was head of the Operations function in her organization when her boss was struck with a severe illness ...
-
Healthcare maintenance is dependent on a CMMS (computerized maintenance management software) to meet the varieties of facilities that are re...
-
Student Suicide: What Teachers Must Do and Mustn't Do By Dickson Adom Suicide rates among students are on the ascendancy globally. Sui...
-
How unreasonable are you? Odd question, isn't it? I for one try to be reasonable most of the time, though my loved ones may not agree! ...
-
I've been a musician for over 50 years! Wow, just typing that has made me flashback to a zillion hours of practice and performance. My m...
-
Electrical panel is an important component of the electricity supply system to be installed for its functioning. It divides the electrical p...
-
By Doug Setter The high school or workplace bully preys on the weaker people. By getting physically stronger, you are less of a target an...
No comments:
Post a Comment
Informations From: Article copyright