您的位置:首页 > 健康 > 美食 > 专业网站设计专业服务_发布产品的免费平台有哪些_大数据营销名词解释_一元友情链接平台

专业网站设计专业服务_发布产品的免费平台有哪些_大数据营销名词解释_一元友情链接平台

2025/1/8 12:56:59 来源:https://blog.csdn.net/geovindu/article/details/144792155  浏览:    关键词:专业网站设计专业服务_发布产品的免费平台有哪些_大数据营销名词解释_一元友情链接平台
专业网站设计专业服务_发布产品的免费平台有哪些_大数据营销名词解释_一元友情链接平台
--  oracle 21c
create user c##geovindu identified by 88888;
grant create session,create table,unlimited tablespace to c##geovindu;create user c##geovin identified by 88888;
grant create session,create table,unlimited tablespace to c##geovin;grant connect,resource,dba to c##geovindu;grant connect,resource,dba to c##geovin;

create table:

drop table IF EXISTS School; create table School  --創建表
(SchoolId char(5) NOT NULL,  --  SchoolName nvarchar2(500) NOT NULL,SchoolTelNo  varchar(8)  NULL,        PRIMARY KEY (SchoolId)   --#主鍵
);--对表的说明
comment on table School is '学校表';
--对表中列的说明
comment on column School.SchoolId is 'ID';
comment on column School.SchoolName is '学校名称';
comment on column School.SchoolTelNo is '电话号码';select * from School order by SchoolId;

# encoding: utf-8
# 版权所有 2024 涂聚文有限公司
# 许可信息查看:言語成了邀功盡責的功臣,還需要行爲每日來值班嗎
# 描述:python -m pip install oracledb
# python -m pip install cx_Oracle --upgrade
# pip install cx_Oracle
# Author    : geovindu,Geovin Du 涂聚文.
# IDE       : PyCharm 2024.3 python 3.11
# os        : windows 10
# database  : mysql 9.0 sql server 2019, poostgreSQL 17.0 oracle 21c
# Datetime  : 2024/12/28 12:15
# User      : geovindu
# Product   : PyCharm
# Project   : Pysimple
# File      : oracledemo.py
# explain   : 学习
import getpass
import oracledb
import cx_Oracleclass SchoolInfo(object):""""""def __init__(self):""""""self.__idno = Noneself.__schoolname = Noneself.__schooltel = None@propertydef idno(self):""":return:"""return self.__idno@idno.setterdef idno(self, no: str):""":param no::return:"""self.__idno = no@propertydef schoolname(self):""":return:"""return self.__schoolname@schoolname.setterdef schoolname(self, name: str):""":param name::return:"""self.__schoolname = name@propertydef schooltel(self):""":return:"""return self.__schooltel@schooltel.setterdef schooltel(self, tel: str):""":param city::return:"""self.__schooltel = tel# 连接到Oracle数据库
connection = cx_Oracle.connect(user="c##geovindu", password="888888", dsn="localhost/TechnologyGame")# 创建游标
cursor = connection.cursor()# 执行查询
cursor.execute("SELECT * FROM School order by SchoolId")# 获取查询结果
result = cursor.fetchall()# 打印查询结果
dt = []
# 打印查询结果
for idno, name, tel in result:# print(idno,name,tel)info = SchoolInfo()info.idno = idnoinfo.schoolname = nameinfo.schooltel = teldt.append(info)
print("****************")
for dd in dt:print(dd.idno, dd.schoolname, dd.schooltel)

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com