Connect win8.1c ++ odbc to the oracle database on centos

Source: Internet
Author: User
Since oracle is not installed in windows, an oracleinstantclient is installed to configure tnsname first. ora is located in D: dev_softwareoracleproduct11.2.0client_1networkadmin. If not, copy one from the sample in the directory to add it. The following configuration is ORCL, which is followed by the database ipport.

Since oracle is not installed in windows, an oracle instant client is installed to configure tnsname first. ora is located at D: \ dev_software \ oracle \ product \ 11.2.0 \ client_1 \ network \ admin. If not, copy one from the sample in the directory to add it, configure ORCL as the database name host followed by the database ip port as follows:

Since oracle is not installed in windows, an oracle instant client is installed.

Configure tnsname. ora first

In D: \ dev_software \ oracle \ product \ 11.2.0 \ client_1 \ network \ admin

If not, copy the sample from the directory.

Add the following Configuration:

ORCL indicates the database name.

The host is followed by the database ip Address

Port: port

SERVICE_NAME is the oracle sid configured for centos Installation

ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.10) (PORT = 1521 ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)

(You can install a plsql statement to test whether it is successful)

Reference this website http://www.2cto.com/database/201305/212209.html

Complete odbc data source configuration

If the oracle database cannot be found, download the odbc installation package from the official website.


Note that when connecting to the database through code

M_retcode = SQLConnect (m_hdbc, (SQLCHAR *) m_szServerName, SQL _cnt, (SQLCHAR *) m_szUserName, SQL _cnt, (SQLCHAR *) m_szPassWord, SQL _cnt );

M_szServerName indicates the ORCL configured above.

M_szUserName is the username used to configure the odbc data source.

M_szPassWord indicates the password.


Odbc database connection code, refer

Http://social.msdn.microsoft.com/Forums/zh-CN/51e0672e-fd93-41ec-a2f9-fed6c42c2c15/sqlconnect? Forum = visualcpluszhchs

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.