我正在运行 Oracle 10g 第 2 版,并且从我的 sqlplus 中,Oracle DB 侦听器已启动并正在运行,我可以向数据库发出并执行命令,如下所示
bash-3.00$ sqlplus /nolog
SQL*Plus: Release 10.2.0.2.0 - Production on Thu Oct 20 18:33:33 2011
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
SQL> connect system/muzaaya
Connected.
SQL> create table fruits (
2 fruit_name VARCHAR(30) PRIMARY KEY,
3 fruit_biological_name VARCHAR2(50),
4 fruit_quantity INT NOT NULL,
5 fruit_location VARCHAR(20) NOT NULL);
Table created.
SQL>
然后我转到此处:http://www.datadirect.com/download.html 为我自己获取 ODBC 连接器甲骨文。我下载并安装在 Windows 7 64 位上。然后,我继续使用 Windows Windows ODBC Administrator
配置数据源。我创建了一个名为 D1
的 DSN,输入描述、服务器名称、客户端版本、用户名和密码,最后我测试连接,连接完美建立!
之后,我转到我的 erlang 并启动我们的 odbc 应用程序,如下所示:
1> odbc:start().
ok
2> odbc:connect("DSN=D1;UID=system;PWD=muzaaya", []).
{error,"[Microsoft][ODBC Driver Manager] The specified DSN contains an
architecture mismatch between the Driver and Application SQLSTATE IS:
IM014 Connection to database failed."}
这是什么意思?我该如何纠正它,以便从 Erlang 连接到我的 Oracle DB?
有人可以给我任何来自 Erlang 的 Oracle 特定 ODBC 连接示例(如果有的话)或一些相关经验一种不同的语言,以便我可以在这里和那里进行比较和更改?
除了这些之外,是否还需要在 Erlang ODBC 连接中指定更多参数才能连接到 ORACLE,例如 tnsnames.ora、spfile 或 pfile
我已经在 ODBC 设置中指定了?
I have Oracle 10g Release 2 running, and from my sqlplus, the Oracle DB listener is up and running and i can issue and execute commands to the database, as shown below
bash-3.00$ sqlplus /nolog
SQL*Plus: Release 10.2.0.2.0 - Production on Thu Oct 20 18:33:33 2011
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
SQL> connect system/muzaaya
Connected.
SQL> create table fruits (
2 fruit_name VARCHAR(30) PRIMARY KEY,
3 fruit_biological_name VARCHAR2(50),
4 fruit_quantity INT NOT NULL,
5 fruit_location VARCHAR(20) NOT NULL);
Table created.
SQL>
I then go here: http://www.datadirect.com/download.html to get my self an ODBC Connector for Oracle. I download it and install it on Windows 7 64 bit. I then go ahead and configure Data Sources using my windows Windows ODBC Administrator
. I create a DSN called D1
, enter description, server name, client version, username and password and lastly i test the connection and the connection is perfectly established!
After this, i go to my erlang and start our odbc application, this is what happens below:
1> odbc:start().
ok
2> odbc:connect("DSN=D1;UID=system;PWD=muzaaya", []).
{error,"[Microsoft][ODBC Driver Manager] The specified DSN contains an
architecture mismatch between the Driver and Application SQLSTATE IS:
IM014 Connection to database failed."}
What does this mean ? and how do i correct it so as to connect to my Oracle DB from Erlang ?
Can some one give me any Oracle specific ODBC connection examples (if there any) from Erlang or some related experience in a different language so as i can make comparison and change here and there ?
Are there more parameters that need to be specified in our Erlang ODBC connection in order to connect to ORACLE, say for example tnsnames.ora,spfile, or pfile
, other than the ones i have already specified in the ODBC settings?
发布评论
评论(1)
在我看来,这就像“架构不匹配”。我以前从未使用过 odbc,但快速 Google 搜索返回了以下结果:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms712362(v=vs.85).aspx
在哪里,您读到:
然后提出了解决方案:
It looks to me like an "architecture mismatch". I have never used odbc before, but a quick Google search returned the following result:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms712362(v=vs.85).aspx
Where, you read:
And then a solution is proposed: