DB Class

For programmers to need to access MySQL database by python,this tested source code is useful.

It is available to execute SQL statement like ‘create database’,’insert’,’select’,etc.
Also tables can be joined and use transaction by commit or rollback.

Specification

IDSTCD_0000000006
LanguagePython
Steps292
PurposeOperate MYSQL database.
Functioncreate database
create table
show columns
create index
insert
update
select
delete
drop index
drop table
drop database
commit
rollback
EnvironmentAnaconda3(Python 3.9.7)
IDE : Visual Studio Code
mysql
mysql_connector
Restrictionfree license
You can use source code copy as owner .
You can customize and distribute it freely.
Price7 dollars or 700 yen
(Pay with PayPal)
Referenceshttps://dev.mysql.com/doc/connector-python/en/connector-python-introduction.html
https://dev.mysql.com/doc/connector-python/en/connector-python-api-mysqlcursor-execute.html

https://isgs-lab.com/613/

Source Code

Test Result

NOtest caseresult
01sql function test
– create database
– create table
– show columns
– create index
– insert
– update
– select
– delete
– drop index
– drop table
– drop database
OK
02join table test
– inner join
– outer join
OK
03transaction test
– commit
– rollback
OK

Test Code

*) Modify “path” along your PC environment.

History

26/11/2022 created

Provider Profile

Nick name is “Dead Fish” employed as an engineer in Japan.
I am grad if you need my code.
Thanks !

Download

Get download password

Following files and data are zipped.

└── DbClass.py

Remarks

None

Comments

Copied title and URL