程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python operation of Dameng database

編輯:Python

python The database of Dameng is operated by the official data provided by Dameng dmPython package .

Use python There are several key points to connect to Damon database :

One 、 Environment for program deployment (win still linux)

Two 、 Database deployment environment (win still linux)

3、 ... and 、 The two are not in the same environment ?

When connecting to Dameng database , In fact, the most important thing is the third point . If the library and the program are together , So directly python3 setup.py install  You can install it dmPython package . Then start to operate like connecting other data .

If the library is linux In the environment , And the program is win Next , Or library in linux Next , The program is on another computer linux Under the machine , There is an important environmental problem to be solved in the connection process .

dmPython This package needs to call some specified files under the Damon database during the running process , So if the library and the program are not on the same machine , These files could not be found , Naturally, you can't call . So if you want to run , But I don't want to build a dream environment , You need to put the installed data in the database directory of Damon bin,drivers,include These three file directories are copied to the same environment as the program , Then configure the environment variables
DM_HOME=/home/dmdba/dmdbms


LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/dmdba/dmdbms/drivers/dpi/
After these two environment variables are configured, you can install dmPython package , You can download it from the official website of Dameng database , stay pypi Kuxia tried , There is no corresponding package . Then install .

stay win In the environment , Most of the time, I will report a lack c++14 The problem of . Need to download and install . The solution is the lack of any environment , Just solve any environmental problems . Step by step . There is nothing else to do .

Dameng database is in use , It's not very friendly to novices , Record it here .

While building the watch , Remember all the table names , Do not use double quotation marks for fields , After double quotation marks , The database will assume that "id" Is field , Even the field ID contains double quotation marks , In the process of subsequent use , If you need to specify a field query , Just put double quotation marks on the field . This is very inconvenient . Another is to finish adding 、 Delete 、 Change 、 Be sure to submit after checking . Otherwise, the database will not be submitted automatically . And it is easy to cause the lock timeout problem . This is a headache . You need to execute another string of code to unlock and then use .

So be careful when operating , Otherwise, it's easy to suffer the loss of no culture .


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved