nevada

Open database connectivity

Open database connectivity

ODBC or Open Database Connectivity is an open normal utility programming interface used to entry heterogeneous knowledge sources.

Think about you have written a number of PHP applications that connect with an Oracle database. For some purpose you’ve now determined to make use of MYSQL as an alternative of Oracle. Assuming you used a local connection to Oracle, it will take a whole lot of coding effort to switch every of the PHP applications to connect with MYSQL, because it already has connection strings in Oracle.

ODBC now gives seamless open database connectivity by way of easy APIs to quite a lot of knowledge sources reminiscent of MYSQL, MS-ACCESS, MSSQL, Oracle, and so forth. You should create an ODBC connection for the precise knowledge supply. This may be finished utilizing the ODBC dialog field which might be accessed from the management panel. One requires an ODBC driver to be put in through the dynamic hyperlink libraries. There are three varieties of DSNs (knowledge supply names), specifically consumer DSNs, system DSNs, and file DSNs.

After guaranteeing that the motive force required to connect with a knowledge supply is current, it’s essential to add the info supply by manually including a knowledge supply from the ODBC dialog field in Management Panel. After including a database it’s essential configure it. The tactic for organising a database varies from database to database. For instance, it’s completely different for Oracle than for MS-ACCESS as a result of Oracle has a TNS (Clear Community Substrate) layer.). Within the case of Oracle, the TNS service title is required to create an ODBC connection between the shopper and the server. Within the case of Microsoft Entry, you solely have to specify the community location of the Entry database and the title of the database. The ODBC supervisor accessible from the management panel will care for all these issues whereas making an attempt to create a DSN title.

Right here is an instance of a PHP program that connects to a MYSQL database utilizing a DSN named “TestDSN”.

$conn=odbc_connect('TestDSN','','');

$sql="SELECT * FROM Worker";

$cursor =odbc_exec($conn,$sql)

A PHP program can even connect with a database utilizing a DSNLESS connection. The drawback of utilizing a DSN-based connection string in a server-client system is that it’s essential configure the DSN or a number of DSNs which can be utilized in server-side scripts (reminiscent of PHP) on the shopper computer systems or on a number of shopper computer systems . It’s because when a shopper laptop encounters an ODBC string in a PHP program, the DSN string have to be configured on the native shopper. This might not be attainable when there are various customers utilizing these applications. In such instances, DSN Much less connections are used the place the server IP tackle/database title, consumer ID and password are talked about instantly within the connection string.

#Open #database #connectivity

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Check Also
Close
Back to top button
سيتات آورج 2022 سيتات آورج 2022