xlang v5.1 Release
程序设计语言基础库文档
载入中...
搜索中...
未找到
Mysql类 参考
类 Mysql 继承关系图:
Inheritance graph
Mysql 的协作图:
Collaboration graph

结构体

class  Helper
 
enum  MysqlOption
 
class  MysqlPreparedResultSet
 
class  MysqlPreparedStatement
 
class  MysqlRegister
 
class  MysqlResultSet
 
class  MysqlStatement
 

Public 成员函数

静态 Public 成员函数

静态 Public 属性

包函数

包属性

静态包属性

额外继承的成员函数

详细描述

在文件 Mysql.xcsm4 行定义.

成员函数说明

◆ close()

void close ( )
override

实现了 Connection.

在文件 Mysql.xcsm821 行定义.

821 {
822 //TODO:
823 if (_mysql != nilptr) {
824 Helper.x_mysql_close (_mysql);
825 _mysql = nilptr;
826 }
827 }
byte [] _mysql
Definition Mysql.xcsm:87

引用了 _mysql.

被这些函数引用 finalize().

这是这个函数的调用关系图:

◆ create()

void create ( String  uri,
String  username,
String  pwd 
)
override

实现了 Connection.

在文件 Mysql.xcsm833 行定义.

833 {
834 //TODO:
835 byte [] __mysql = new byte[2048];
836
837
838 if (0l == Helper.x_mysql_init (__mysql) ) {
839 throw new Sql.SqlException (Helper.x_mysql_errno (__mysql), Helper.x_mysql_error (__mysql) );
840 }
841
842 if (timeout != 0) {
843 if (0 == Helper.x_mysql_options (__mysql, 0, timeout) ) {
844 throw new Sql.SqlException (Helper.x_mysql_errno (__mysql), Helper.x_mysql_error (__mysql) );
845 }
846 }
847
848 if (0l == Helper.x_mysql_real_connect (__mysql, uri, username, pwd, nilptr, port, nilptr, client_flags) ) {
849 throw new Sql.SqlException (Helper.x_mysql_errno (__mysql), Helper.x_mysql_error (__mysql) );
850 }
851
852 _mysql = __mysql;
853 }
int timeout
Definition Mysql.xcsm:90
int port
Definition Mysql.xcsm:89
int client_flags
Definition Mysql.xcsm:92

引用了 _mysql, client_flags, port , 以及 timeout.

◆ createStatement()

Sql.Statement createStatement ( )
override

实现了 Connection.

在文件 Mysql.xcsm933 行定义.

933 {
934 return new MysqlStatement (this);
935 }

◆ finalize()

void finalize ( )
package

在文件 Mysql.xcsm829 行定义.

829 {
830 close();
831 }
void close() override
Definition Mysql.xcsm:821

引用了 close().

函数调用图:

◆ getError()

◆ getErrorCode()

◆ getInfo()

String getInfo ( )

在文件 Mysql.xcsm873 行定义.

873 {
874 return Helper.x_mysql_info (_mysql);
875 }

引用了 _mysql.

◆ getOption()

Object getOption ( int  opt)
override

实现了 Connection.

在文件 Mysql.xcsm877 行定义.

877 {
878 //TODO:
879 throw new Sql.DatabaseNotSupportException ("getOption");
880 return nilptr;
881 }

◆ getSqlState()

String getSqlState ( )

在文件 Mysql.xcsm869 行定义.

869 {
870 return Helper.x_mysql_state (_mysql);
871 }

引用了 _mysql.

◆ isClosed()

bool isClosed ( )
override

实现了 Connection.

在文件 Mysql.xcsm855 行定义.

855 {
856 //TODO:
857 return _mysql != nilptr;
858 }

引用了 _mysql.

◆ prepareStatement()

Sql.PreparedStatement prepareStatement ( String  sql)
override

实现了 Connection.

在文件 Mysql.xcsm937 行定义.

937 {
938 return new MysqlPreparedStatement (this, sql);
939 }

◆ registry()

static bool registry ( )
static

在文件 Mysql.xcsm114 行定义.

114 {
115 if (Helper.init() ) {
116 Sql.Database.reigstry (DRIVERNAME, new MysqlRegister() );
117 return true;
118 }
119
120 return false;
121 }
static const String DRIVERNAME
Definition Mysql.xcsm:86

引用了 DRIVERNAME.

◆ setOption()

void setOption ( int  opt,
Object  option 
)
override

实现了 Connection.

在文件 Mysql.xcsm883 行定义.

883 {
884 switch (opt) {
885 case MysqlOption.PORT:
886 port = (int) option;
887 break;
888
889 case MysqlOption.TIMEOUT:
890 timeout = (int) option;
891 break;
892
893 case MysqlOption.CHARSET:
894 if (_mysql == nilptr) {
895 throw new Sql.SqlException (-1, "mysql not connected!");
896 }
897
898 if (0 != Helper.x_mysql_set_character_set (_mysql, (String) option) ) {
899 throw new Sql.SqlException (Helper.x_mysql_errno (_mysql), Helper.x_mysql_error (_mysql) );
900 }
901
902 break;
903
904 case MysqlOption.SELECTDB:
905 if (_mysql == nilptr) {
906 throw new Sql.SqlException (-1, "mysql not connected!");
907 }
908
909 if (0 != Helper.x_mysql_select_db (_mysql, (String) option) ) {
910 throw new Sql.SqlException (Helper.x_mysql_errno (_mysql), Helper.x_mysql_error (_mysql) );
911 }
912
913 break;
914
915 case MysqlOption.RET_ERRCODE:
916 return_option = MysqlOption.RET_ERRCODE;
917 break;
918
919 case MysqlOption.RET_CHANGES:
920 return_option = MysqlOption.RET_CHANGES;
921 break;
922
923 case MysqlOption.CLIENT_FLAGS:
924 client_flags = (int) option;
925 break;
926
927 default:
928 throw new Sql.DatabaseNotSupportException ("setOption:" + opt);
929 break;
930 }
931 }
int return_option
Definition Mysql.xcsm:91
Definition String.x:5

引用了 _mysql, client_flags, port, return_option , 以及 timeout.

结构体成员变量说明

◆ _mysql

◆ CLIENT_ALL_FLAGS

const int CLIENT_ALL_FLAGS
static
初始值:
)
static const int CLIENT_PLUGIN_AUTH
Definition Mysql.xcsm:25
static const int CLIENT_INTERACTIVE
Definition Mysql.xcsm:15
static const int CLIENT_NO_SCHEMA
Definition Mysql.xcsm:9
static const int CLIENT_TRANSACTIONS
Definition Mysql.xcsm:18
static const int CLIENT_PS_MULTI_RESULTS
Definition Mysql.xcsm:23
static const int CLIENT_LONG_FLAG
Definition Mysql.xcsm:7
static const int CLIENT_MULTI_STATEMENTS
Definition Mysql.xcsm:21
static const int CLIENT_CONNECT_WITH_DB
Definition Mysql.xcsm:8
static const int CLIENT_SSL
Definition Mysql.xcsm:16
static const int CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA
Definition Mysql.xcsm:29
static const int CLIENT_ODBC
Definition Mysql.xcsm:11
static const int CLIENT_MULTI_RESULTS
Definition Mysql.xcsm:22
static const int CLIENT_COMPRESS
Definition Mysql.xcsm:10
static const int CLIENT_IGNORE_SIGPIPE
Definition Mysql.xcsm:17
static const int CLIENT_DEPRECATE_EOF
Definition Mysql.xcsm:40
static const int CLIENT_RESERVED
Definition Mysql.xcsm:19
static const int CLIENT_LONG_PASSWORD
Definition Mysql.xcsm:5
static const int CLIENT_REMEMBER_OPTIONS
Definition Mysql.xcsm:43
static const int CLIENT_FOUND_ROWS
Definition Mysql.xcsm:6
static const int CLIENT_CONNECT_ATTRS
Definition Mysql.xcsm:26
static const int CLIENT_PROTOCOL_41
Definition Mysql.xcsm:14
static const int CLIENT_IGNORE_SPACE
Definition Mysql.xcsm:13
static const int CLIENT_RESERVED2
Definition Mysql.xcsm:20
static const int CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS
Definition Mysql.xcsm:32
static const int CLIENT_LOCAL_FILES
Definition Mysql.xcsm:12
static const int CLIENT_SESSION_TRACK
Definition Mysql.xcsm:38
static const int CLIENT_SSL_VERIFY_SERVER_CERT
Definition Mysql.xcsm:42

在文件 Mysql.xcsm48 行定义.

◆ CLIENT_BASIC_FLAGS

const int CLIENT_BASIC_FLAGS
static
初始值:
= ( ( (CLIENT_ALL_FLAGS & ~CLIENT_SSL)
& ~CLIENT_SSL_VERIFY_SERVER_CERT)
static const int CLIENT_ALL_FLAGS
Definition Mysql.xcsm:48

在文件 Mysql.xcsm82 行定义.

◆ CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS

const int CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS = (1 << 22)
static

在文件 Mysql.xcsm32 行定义.

◆ CLIENT_COMPRESS

const int CLIENT_COMPRESS = 32
static

在文件 Mysql.xcsm10 行定义.

◆ CLIENT_CONNECT_ATTRS

const int CLIENT_CONNECT_ATTRS = (1 << 20)
static

在文件 Mysql.xcsm26 行定义.

◆ CLIENT_CONNECT_WITH_DB

const int CLIENT_CONNECT_WITH_DB = 8
static

在文件 Mysql.xcsm8 行定义.

◆ CLIENT_DEPRECATE_EOF

const int CLIENT_DEPRECATE_EOF = (1 << 24)
static

在文件 Mysql.xcsm40 行定义.

◆ client_flags

int client_flags = 0
package

在文件 Mysql.xcsm92 行定义.

被这些函数引用 create() , 以及 setOption().

◆ CLIENT_FOUND_ROWS

const int CLIENT_FOUND_ROWS = 2
static

在文件 Mysql.xcsm6 行定义.

◆ CLIENT_IGNORE_SIGPIPE

const int CLIENT_IGNORE_SIGPIPE = 4096
static

在文件 Mysql.xcsm17 行定义.

◆ CLIENT_IGNORE_SPACE

const int CLIENT_IGNORE_SPACE = 256
static

在文件 Mysql.xcsm13 行定义.

◆ CLIENT_INTERACTIVE

const int CLIENT_INTERACTIVE = 1024
static

在文件 Mysql.xcsm15 行定义.

◆ CLIENT_LOCAL_FILES

const int CLIENT_LOCAL_FILES = 128
static

在文件 Mysql.xcsm12 行定义.

◆ CLIENT_LONG_FLAG

const int CLIENT_LONG_FLAG = 4
static

在文件 Mysql.xcsm7 行定义.

◆ CLIENT_LONG_PASSWORD

const int CLIENT_LONG_PASSWORD = 1
static

在文件 Mysql.xcsm5 行定义.

◆ CLIENT_MULTI_RESULTS

const int CLIENT_MULTI_RESULTS = (1 << 17)
static

在文件 Mysql.xcsm22 行定义.

◆ CLIENT_MULTI_STATEMENTS

const int CLIENT_MULTI_STATEMENTS = (1 << 16)
static

在文件 Mysql.xcsm21 行定义.

◆ CLIENT_NO_SCHEMA

const int CLIENT_NO_SCHEMA = 16
static

在文件 Mysql.xcsm9 行定义.

◆ CLIENT_ODBC

const int CLIENT_ODBC = 64
static

在文件 Mysql.xcsm11 行定义.

◆ CLIENT_PLUGIN_AUTH

const int CLIENT_PLUGIN_AUTH = (1 << 19)
static

在文件 Mysql.xcsm25 行定义.

◆ CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA

const int CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA = (1 << 21)
static

在文件 Mysql.xcsm29 行定义.

◆ CLIENT_PROTOCOL_41

const int CLIENT_PROTOCOL_41 = 512
static

在文件 Mysql.xcsm14 行定义.

◆ CLIENT_PS_MULTI_RESULTS

const int CLIENT_PS_MULTI_RESULTS = (1 << 18)
static

在文件 Mysql.xcsm23 行定义.

◆ CLIENT_REMEMBER_OPTIONS

const int CLIENT_REMEMBER_OPTIONS = (1 << 31)
static

在文件 Mysql.xcsm43 行定义.

◆ CLIENT_RESERVED

const int CLIENT_RESERVED = 16384
static

在文件 Mysql.xcsm19 行定义.

◆ CLIENT_RESERVED2

const int CLIENT_RESERVED2 = 32768
static

在文件 Mysql.xcsm20 行定义.

◆ CLIENT_SESSION_TRACK

const int CLIENT_SESSION_TRACK = (1 << 23)
static

Capable of handling server state change information. Its a hint to the server to include the state change information in Ok packet.

在文件 Mysql.xcsm38 行定义.

◆ CLIENT_SSL

const int CLIENT_SSL = 2048
static

在文件 Mysql.xcsm16 行定义.

◆ CLIENT_SSL_VERIFY_SERVER_CERT

const int CLIENT_SSL_VERIFY_SERVER_CERT = (1 << 30)
static

在文件 Mysql.xcsm42 行定义.

◆ CLIENT_TRANSACTIONS

const int CLIENT_TRANSACTIONS = 8192
static

在文件 Mysql.xcsm18 行定义.

◆ DRIVERNAME

const String DRIVERNAME = "mysql"
staticpackage

在文件 Mysql.xcsm86 行定义.

被这些函数引用 registry().

◆ port

int port = 3306
package

在文件 Mysql.xcsm89 行定义.

被这些函数引用 create() , 以及 setOption().

◆ registried

bool registried = registry()
staticpackage

在文件 Mysql.xcsm234 行定义.

◆ return_option

◆ timeout

int timeout = 0
package

在文件 Mysql.xcsm90 行定义.

被这些函数引用 create() , 以及 setOption().