Erlang ODBC 连接挑战

发布于 2024-12-10 21:35:33 字数 1445 浏览 0 评论 0 原文

我正在运行 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眼泪淡了忧伤 2024-12-17 21:35:33

在我看来,这就像“架构不匹配”。我以前从未使用过 odbc,但快速 Google 搜索返回了以下结果:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms712362(v=vs.85).aspx

在哪里,您读到:

如果您使用 64 位 odbcad32.exe 配置或删除 DSN
连接到 32 位驱动程序,例如 Driver do Microsoft Access
(*.mdb),您将收到以下错误消息:

指定的 DSN 之间的体系结构不匹配
驱动程序和应用程序

然后提出了解决方案:

要解决此错误,请使用 32 位 odbcad32.exe 进行配置或
删除 DSN。

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:

If you use the 64-bit odbcad32.exe to configure or remove a DSN that
connects to a 32-bit driver, for example, Driver do Microsoft Access
(*.mdb), you will receive the following error message:

The specified DSN contains an architecture mismatch between the
Driver and Application

And then a solution is proposed:

To resolve this error, use the 32-bit odbcad32.exe to configure or
remove the DSN.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文