Skip to main content

Overview of connection methods

This section describes the methods for connecting to and accessing seekdb. Currently, you can connect to seekdb by using a client, a driver, an ORM framework, or a connection pool.

Choose a client to connect to seekdb

The following clients are supported for connecting to seekdb:

  • MySQL client (mysql)

    mysql is a command-line client for MySQL databases. It must be installed separately.

    After you connect to seekdb, you can run mysql commands and SQL statements in the mysql command-line environment to perform the following tasks:

    • Calculate, store, and print query results.

    • Create database objects, check, and modify object definitions.

    • Execute database management and parameter modification operations.

    For more information about how to connect to seekdb by using the MySQL client, see Connect to seekdb by using a MySQL client.

Choose a driver or ORM framework to connect to seekdb

C

  • C driver (OceanBase Connector/C)

    OceanBase Connector/C is a client development component for OceanBase based on C/C++. It supports the C API library.

    OceanBase Connector/C allows C/C++ programs to access seekdb in a relatively low-level manner, enabling operations such as database connection, data access, error handling, and prepared statement processing.

    OceanBase Connector/C is also known as LibOBClient. It enables applications to communicate with OBServer nodes of the database server as independent server processes over the network. Client programs reference C API header files during compilation and can connect to C API library files.

    info

    The shared object (so) file generated by LibOBClient is libobclient.so (corresponding to MySQL's libmysqlclient.so).

    For a specific example of connecting to seekdb using a C application, see Connect to seekdb using MySQL Connector/C.

Golang

  • Golang driver

    • Go-SQL-Driver/MySQL

      Go-SQL-Driver/MySQL is a MySQL driver implemented in Go, which follows the Go database/sql standard interface. It can be easily integrated with Go applications. For a specific example of connecting to seekdb using Go-SQL-Driver/MySQL, see Connect to seekdb using Go-SQL-Driver/MySQL.

  • Golang ORM

    • GORM

      GORM is an excellent ORM (Object-Relational Mapping) library for Go, providing a wide range of features to help developers interact with databases more easily. For a specific example of connecting to seekdb using GORM, see Connect to seekdb using GORM.

Java

PHP

  • PHP driver

    • EXT

      EXT (PHP Extension) is an extension for PHP that enables connection and interaction with various databases. It provides a variety of features to help developers better manage databases and process data. For a specific example of connecting to seekdb using EXT, see Connect to seekdb using the EXT driver.

    • MySQLi

      MySQLi (MySQL Improved) is an extension provided by PHP for interacting with MySQL databases. It supports both object-oriented and procedural programming, offering features like prepared statements, transaction support, and multi-query execution to enhance performance and security. For a specific example of connecting to seekdb using MySQLi, see Connect to seekdb using the MySQLi driver.

    • PDO

      PDO (PHP Data Objects) is a database access abstraction layer that allows developers to interact with various databases in a unified manner. PDO supports prepared statements, enhancing security and simplifying code migration between different databases. For a specific example of connecting to seekdb using PDO, see Connect to seekdb using the PDO driver.

Python

  • Python driver (PyMySQL)

    • PyMySQL

      PyMySQL is a library for connecting to a MySQL server in Python 3.x. It follows the Python Database API Specification 2.0 and includes a pure-Python MySQL client library. In seekdb, users can use the PyMySQL driver to establish a connection between Python applications and seekdb. For a specific example of how to connect a Python application to seekdb using PyMySQL, see PyMySQL connection to seekdb sample program.

    • mysqlclient

      mysqlclient is a Python client library for MySQL databases, which wraps the official MySQL C API. For a specific example of how to connect a Python application to seekdb using mysqlclient, see mysqlclient connection to seekdb sample program.

    • MySQL-connector-python

      MySQL-connector-python is an official MySQL database driver provided by Oracle, specifically designed for Python. It adheres to the Python Database API Specification 2.0 and offers a comprehensive set of features for interacting with MySQL databases through Python code. This library is cross-platform, supports both Python 2 and 3, and is implemented entirely in pure Python without relying on any external libraries. In seekdb, MySQL-connector-python can be used to establish connections, execute queries, and manage data. For a specific example of how to connect a Python application to seekdb using MySQL-connector-python, see Create a MySQL-connector-python connection to seekdb sample program.

Database connection pools

seekdb supports multiple database connection pools. You can select a connection pool based on your business requirements.