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