Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть Database Systems - Python Database Programming - Connector/Python

  • Appficial
  • 2021-09-22
  • 393
Database Systems - Python Database Programming - Connector/Python
  • ok logo

Скачать Database Systems - Python Database Programming - Connector/Python бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно Database Systems - Python Database Programming - Connector/Python или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку Database Systems - Python Database Programming - Connector/Python бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео Database Systems - Python Database Programming - Connector/Python

Connector/Python is a MySQL component based on the DB-API standard from the Python Software Foundation
Setup your Python program for database programming:
Install the Connector/Python with command: pip install mysql-connector-python
Import mysql.connector
Connect with mysql.connector.connect() within a try-except statement
Close the connection with connection.close()

The MySQLCursor class creates a cursor object that can execute SQL statements and stores the results.

connection.cursor() - creates the cursor for the database connection object. The same cursor is used for all your SQL statements for that database connection.
cursor.execute()  - executes the SQL statements, passed as a string parameter, after they are compiled
cursor.close()  - releases and closes the cursor object. This should be done after any commit or rollback, but before closing the database connection.
connection.commit() - saves the results of SQL statements such as INSERT, DELETE, or UPDATE
connection.rollback() - discards database changes

cursor.rowcount - returns the number of rows in the query result.
cursor.column_names - returns a list of column names in a query result.
cursor.fetchwarnings() - returns a list of warnings that the query generated.

Query parameters are used to substitute Python values into a SQL statement. To pass query parameters in the cursor.execute() method call, the second argument can have %s placeholders passed to it, with a python tuple containing the values in the correct order. The data types of the python values get converted to the correct MySQL data type.

It’s better to use placeholders with cursor.execute() rather than to just write the SQL statement with the actual data, because it could prevent a SQL injection attack, where a hacker can try to change the values of the SQL statements.

Fetch methods access the query results of SELECT statements when you call the cursor.execute() method.

cursor.fetchone() - returns a tuple containing a single result row. It returns None if there are no rows are selected. If there are many rows, cursor.fetchone() can be executed in a loop until None is returned and the loop ends.

cursor.fetchall() - returns a list of tuples containing the results of all rows. You can loop through the tuple list to process it.


Subscribe to Appficial for more programming videos coming soon. Also, don't forget to click LIKE and comment on the video if it helped you out!

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]