伊人久久一区二区三区四区,色偷偷,色噜噜污网站,啦啦啦www视频在线观看,成人亚洲一区二区三区在线

Pysqlite Windows下載 最新軟件|熱門排行|軟件分類|軟件專題|廠商大全

您的位置: 首頁編程開發數據庫類 → Pysqlite(嵌入式數據庫python api 接口) v2.6.3 官方版

Pysqlite(嵌入式數據庫python api 接口)

v2.6.3 官方版 Pysqlite(嵌入式數據庫python api 接口) 網友評分:8

同類相關軟件

軟件介紹

軟件標簽: Pysqlite python 數據庫

Pysqlite Windows是一款專為windows用戶打造的api接口,旨在更好的幫助 sqlite 操作者工作,需要的朋友趕緊來綠色資源網下載吧

Pysqlite Windows版簡介

pysqlite是一個sqlite 為 python 提供的 api 接口,它讓一切對于 sqlite 的操作都變得異常簡單。

sqlite,它是一個嵌入式數據庫,沒有服務器的概念,windows版的就是一個exe,自己把它放到一個合適的目錄里,然后把這個目錄加入系統的path變量.

Pysqlite使用說明

在數據庫建立中Windows與Linux也有不同

XP版本:sqlite3.exe test.db

Linux版本:./sqlite3.bin test.db

目前針對不同的python版本,pysqlite有3個版本:2.5和2.6 、2.7,請根據自己的python版本選用.

3.然后就可以打開自己喜歡的編輯器,寫一段測試代碼了.

4.中文處理要注意的是sqlite默認以utf-8編碼存儲.

5.另外要注意sqlite僅支持文件鎖,換句話說,它對并發的處理并不好,不推薦在網絡環境使用,適合單機環境;

import pysqlite2.dbapi2 as sqlite

def runTest():

cx = sqlite.connect('test.db')

cu = cx.cursor()

#create

cu.execute('''create table catalog(

id integer primary key,

pid integer,

name varchar(10) unique

)''')

#insert

cu.execute('insert into catalog values(0,0,"張小山")')

cu.execute('insert into catalog values(1,0,"hello")')

cx.commit()

#select

cu.execute('select * from catalog')

print '1:',

print cu.rowcount

rs = cu.fetchmany(1)

print '2:',

print rs

rs = cu.fetchall()

print '3:',

print rs

#delete

cu.execute('delete from catalog where id = 1 ')

cx.commit()

cu.execute('select * from catalog')

rs = cu.fetchall()

print '4:',

print rs

#select count

cu.execute("select count(*) from catalog")

rs = cu.fetchone()

print '5:',

print rs

cu.execute("select * from catalog")

cu.execute('drop table catalog')

if __name__ == '__main__':

runTest()

數據庫操作

Python的數據庫模塊都有統一的接口標準,所以數據庫操作都基本上是統一的,基本上分成以下幾步(假設數據庫模塊為db):

用db.connect()創建數據庫連接,連接對象為conn。

如果不需要返回查詢結果,就直接調用conn.execute()。

如果需要返回查詢結果,則需要首先通過conn.cursor()創建游標對象cur,并使用cur.fetchone()等函數獲取查詢結果。

根據數據庫隔離級別的不同,修改數據庫后,可能需要使用conn.commit()手動提交事務。

調用相應的close()方法關閉cur及conn。

軟件截圖

下載地址 電腦版

點擊報錯 軟件無法下載或下載后無法使用,請點擊報錯,謝謝!

用戶評論

熱門評論

最新評論

發表評論 查看所有評論(0)

昵稱:
請不要評論無意義或臟話,我們所有評論會有人工審核.
字數: 0/500 (您的評論需要經過審核才能顯示)
主站蜘蛛池模板: 武功县| 鱼台县| 邹城市| 海宁市| 公安县| 长沙市| 祁阳县| 高要市| 桂阳县| 左贡县| 万源市| 嘉禾县| 芒康县| 托里县| 白城市| 平泉县| 土默特左旗| 米脂县| 南宁市| 合肥市| 穆棱市| 昭苏县| 彩票| 威信县| 崇阳县| 溧水县| 集安市| 浦东新区| 舒城县| 本溪| 原阳县| 巍山| 离岛区| 卫辉市| 含山县| 瑞丽市| 宝清县| 井研县| 历史| 太和县| 毕节市|