OceanBase AI Database supports connections through drivers or ORM frameworks, providing flexible access solutions for different programming languages and development scenarios.
C
C driver (OceanBase Connector/C)
OceanBase Connector/C is a C/C++-based client development component for OceanBase, supporting the C API library.
OceanBase Connector/C allows C/C++ programs to access OceanBase AI Database at a relatively low level, performing operations such as database connection, data access, error handling, and prepared statement processing.
OceanBase Connector/C, also known as LibOBClient, is used by applications as an independent server process to communicate with the database server OBServer node over the network. The client program references C API header files during compilation and can connect to the C API library files.
Note
The so file generated by LibOBClient is
libobclient.so(corresponding to MySQL'slibmysqlclient.so), and the command-line tool after OceanBase AI Database installation is OBClient (corresponding to MySQL's command-line tool).For specific examples of connecting to OceanBase AI Database using C applications, see Connect to OceanBase AI Database by using MySQL Connector/C.
Golang
Golang driver
Go-SQL-Driver/MySQL
Go-SQL-Driver/MySQL is a MySQL driver implemented in the Go language. It follows Go's database/sql standard interface, making it easy to integrate with Go applications. For specific examples of connecting to OceanBase AI Database using Go-SQL-Driver/MySQL, see Sample application for connecting to OceanBase AI Database using Go-SQL-Driver/MySQL.
Golang ORM
GORM
GORM is an excellent ORM (Object-Relational Mapping) library for the Go language. It provides rich features to help developers interact with databases more easily. For specific examples of connecting to OceanBase AI Database using GORM, see Example program for connecting to OceanBase AI Database using GORM.
Java
Java driver (MySQL Connector/J)
MySQL Connector/J is the official JDBC driver provided by MySQL.
For specific examples of connecting to OceanBase AI Database using Java drivers, see Connect to OceanBase AI Database by using MySQL Connector/J.
SpringJDBC
For specific examples of connecting to OceanBase AI Database using SpringJDBC, see Sample application for connecting to OceanBase AI Database using Spring JDBC.
Java ORM framework
SpringBoot
For more information about how to connect SpringBoot to OceanBase AI Database, see Sample application for connecting to OceanBase AI Database using SpringBoot.
SpringBatch
For more information about how to connect SpringBatch to OceanBase AI Database, see Sample application for connecting to OceanBase AI Database using SpringBatch.
SpringDataJPA
For more information about how to connect SpringDataJPA to OceanBase AI Database, see Sample application for connecting to OceanBase AI Database using SpringDataJPA.
Hibernate
For more information about how to connect Hibernate to OceanBase AI Database, see Sample application for connecting to OceanBase AI Database using Hibernate.
MyBatis
For more information about how to connect MyBatis to OceanBase AI Database, see Connect to OceanBase AI Database by using MyBatis.
Java library testing tools
TestContainers
TestContainers is an open-source Java library testing tool that provides a lightweight containerized testing environment. It offers a containerized dependency environment, allowing developers to quickly start and manage Docker containers during testing, facilitating integration testing. For more information about how to connect TestContainers to OceanBase AI Database, see Connect to OceanBase AI Database by using Testcontainers for Java.
PHP
PHP drivers
EXT
EXT (PHP Extension) is an extension for PHP used to connect to and interact with different databases. It provides various features to help developers better manipulate databases and process data. For more information about how to connect EXT to OceanBase AI Database, see Connect to OceanBase AI Database by using the EXT driver.
MySQLi
MySQLi (MySQL Improved) is an official PHP extension for interacting with MySQL databases. It supports object-oriented and procedural programming, providing prepared statements, transaction support, and multi-query functionality to enhance performance and security. For more information about how to connect MySQLi to OceanBase AI Database, see Connect to OceanBase AI Database by using the MySQLi driver.
PDO
PDO (PHP Data Objects) is a database access abstraction layer that allows developers to interact with multiple databases in a unified way. PDO supports prepared statements, which helps improve security and makes code migration easier between different databases. For more information about how to connect PDO to OceanBase AI Database, see Connect to OceanBase AI Database by using the PDO driver.
Python
Python driver (PyMySQL)
PyMySQL
PyMySQL is a library for connecting to MySQL servers in Python 3.x. It follows the Python Database API v2.0 specification and includes a pure-Python MySQL client library. You can use the PyMySQL driver to provide connections from Python applications to OceanBase AI Database. For more information about how to connect Python applications to OceanBase AI Database, see Connect to OceanBase AI Database by using PyMySQL.
mysqlclient
mysqlclient is a Python client library for MySQL databases. It encapsulates the official MySQL C API. For example code on how to use mysqlclient to connect to OceanBase AI Database, see Connect to OceanBase AI Database by using mysqlclient.
MySQL-connector-python
MySQL-connector-python is a MySQL database driver officially provided by Oracle and specifically designed for Python. It complies with the Python Database API v2.0 specification and provides a complete set of features to conveniently interact with MySQL databases through Python code. This library is cross-platform, supports Python 2 and 3, and is implemented in pure Python without relying on any external libraries. MySQL-connector-python can also be used to establish connections to OceanBase AI Database for querying and managing data. For example code on how to use MySQL-connector-python to connect to OceanBase AI Database, see Connect to OceanBase AI Database by using MySQL Connector/Python.
SQLAlchemy
SQLAlchemy is an excellent Object-Relational Mapping (ORM) library for the Python language. It provides rich features to help developers interact with databases more easily. For example code on how to use SQLAlchemy to connect to OceanBase AI Database, see Example program for connecting to OceanBase AI Database using SQLAlchemy.
Django
Django is an excellent Object-Relational Mapping (ORM) library for the Python language. It provides rich features to help developers interact with databases more easily. For example code on how to use Django to connect to OceanBase AI Database, see Connect to OceanBase AI Database using Django.
Peew
Peew is an excellent Object-Relational Mapping (ORM) library for the Python language. It provides rich features to help developers interact with databases more easily. For example code on how to use Peew to connect to OceanBase AI Database, see Sample program for connecting to OceanBase AI Database using Peewee.