- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
嗨,我也是 python 和 firebird 的新手,我的问题是我正在尝试将我的 python 程序连接到 firebird 中的数据库,我已经安装了 firebird (当前位于/opt/firebird 上)我已经创建了我的带有表的数据库(test.fdb)(在firebird中工作正常)
create table languages
(
name varchar(20),
year_released integer
);
insert into languages (name, year_released) values ('C', 1972);
insert into languages (name, year_released) values ('Python', 1991);
但是当我尝试在 pydev 中运行时出现问题。
import fdb
con = fdb.connect(dsn="/tmp/test.fdb", user="fernando", password="root")
# Create a Cursor object that operates in the context of Connection con:
cur = con.cursor()
# Execute the SELECT statement:
cur.execute("select * from languages")
# Retrieve all rows as a sequence and print that sequence:
print cur.fetchall()
http://www.firebirdsql.org/file/documentation/drivers_documentation/python/fdb/getting-started.html
数据库的当前位置在/tmp,我使用的是从这里下载的fdb:https://pypi.python.org/pypi/fdb/并与 pip 一起安装,我也在 pydev properties->pydev pythonpath 中使用并添加了 fdb 文件夹(到目前为止似乎正常,没有错误),我的用户名是 fernando,密码是 root,所以当我最终运行时,我收到此错误消息:
Traceback (most recent call last):
File "/home/elfstone/Documents/workspace/NuevosPython/fire.py", line 3, in <module>
con = fdb.connect(dsn="/tmp/test.fdb", user="fernando", password="root")
File "/home/elfstone/Downloads/fdb-1.4/fdb/fbcore.py", line 693, in connect
"Error while connecting to database:")
fdb.fbcore.DatabaseError: ('Error while connecting to database:\n- SQLCODE: -902\n- Unable to complete network request to host "localhost".\n- Failed to establish a connection.', -902, 335544721)
如何解决这个问题?帮助和感谢。
最佳答案
检查了 Ubuntu 12.04.4
和 fdb 1.4.1
所有建议的语句类型都有效:
fdb.connect(dsn="/var/lib/firebird/2.5/data/test.fdb", user="fernando", password="root")
fdb.connect(host="localhost", database="/var/lib/firebird/2.5/data/test.fdb", user="fernando", password="root")
fdb.connect(dsn="localhost:/var/lib/firebird/2.5/data/test.fdb", user="fernando", password="root")
关于python - 为什么我无法在 ubuntu 12.04 中将 python 连接到 firebird?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18504399/
我有一个关于 Firebird 客户端和服务器版本的问题。我知道由于 ODS 更改,数据库文件必须与 Firebird 服务器匹配。即 Firebird 建议在服务器版本 2.5.1 和 2.5.2
是否可以使用相同 Firebird 版本的 Firebird Embedded 打开 Firebird 数据库文件?当然,我知道我不能同时通过 FB Embedded 和 FB 打开同一个文件。但在关
首先我读到了这个问题: Firebird database replication 但我不想复制...我只想将数据库上已更改的数据添加到我们的主数据库中。有什么想法吗? 最佳答案 AFAICT 这也是
我同时使用 Firebird 嵌入式和 Firebird 服务器,有时我需要使用如下程序重新索引表: CREATE PROCEDURE MAINTENANCE_SELECTIVITY ASDECLAR
firebird 是否支持事务模式更改?在我看来,MySQL 没有(我说得对吗?)。 最佳答案 我打算发布一个简单的"is",但 Stack Overflow 不接受少于 15 个字符的答案。简而言之
我正在尝试将 Firebird 2.5.1 迁移到 Firebird 3.0 做了什么: 备份 Firebird 2.5.1 在 Firebird 3 上恢复 问题是并不是所有的表都被迁移了;过程、触
我的意思是,即使数据库为空,您也必须删除 varchar(50) 字段并重新创建它以使其成为 varchar(30)。更别说约束了…… 这是非常令人沮丧的。我是 SYSDBA,Firebird 使非常
当我尝试更改 Firebird 中不同所有者的表时,出现此错误: unsuccessful metadata update MODIFY RDB$RELATION_FIELDS failed no p
我有下表 create table LIST_PIPE_TABLE ( ID INT, ITEM VARCHAR(4000), IS_FOLDER VARCHAR
有没有一种快速的方法来列出为数据库定义的所有实际上没有被任何字段使用的 Firebird 域?我有一个包含许多表和许多域的大型数据库,似乎其中很多不再使用,所以我想是时候进行清理了! 我认为这可以通过
我有一个表 t,其中一列是 int 类型,有几行。 我想循环它。当然,我可以为此编写一个选择查询。不过我是学程序的,写了个程序, set term ^; create procedure qt ret
我正在尝试使用 FlameRobin 打开一个 .fdb (Firebird) 数据库,但它给了我以下错误消息: *** IBPP::SQLException *** Context: Databas
我有一个旧版 Firebird(版本 2.5.2)数据库,并使用 FlameRobin(版本 0.0.2.1851)来检查它。 我已在 RDB$RELATION_CONSTRAINTS 表上运行以下查
我是这里的 Firebird 新手。我正在尝试从 ASP.Net 应用程序使用 Firebird Embedded。一切都连接正常,但我遇到了列名称长度的问题。我正在尝试创建一个名为“Orchard_
刚刚开始将 Firebird 与 Delphi XE 结合使用。需要一些从客户端计算机连接到服务器的帮助。 我可以 ping 服务器,因此存在连接。但是当我从 firebird/bin 文件夹运行 i
我在 Ubuntu 中打开命令提示符,然后登录 Firebird,如下所示: $ isql-fb SQL> connect "localhost:/var/lib/firebird/2.5/data/
已下载 Firebird 数据库 Firebird-3.0.3.32900-0_x64_pdb.zip。解压文件夹install_service.bat并能够访问EMPLOYEE.FDB数据库。无需
如何在 Firebird 中将多个数据库合并为一个?我尝试了 fbexport,但没有在 Ubuntu 上编译 fbexport,我不断收到此错误。 g++ -pthread -lfbclient -
我想查询以下内容:所有表及其列和数据类型 到目前为止,我从 http://www.firebirdfaq.org/faq174/ 得到了这个 select f.rdb$relation_name, f
我有一个接近 4GB 文件系统限制大小的 firebird 数据库。如何将单个数据库文件拆分为多个文件? 最佳答案 对于单个文件数据库,Firebird 数据库可以跨越数 TB。 InterBase
我是一名优秀的程序员,十分优秀!