com.continuent.tungsten.common.mysql
Class MySQLConstants

java.lang.Object
  extended by com.continuent.tungsten.common.mysql.MySQLConstants

public class MySQLConstants
extends java.lang.Object

Provides MySQL protocol constants and server version string.

Version:
$Rev: $, $Date: $
Author:
Csaba Simon (csaba.simon@continuent.com), Gilles Rayrat

Field Summary
static int AUTO_INCREMENT_FLAG
           
static int BINARY_FLAG
           
static int BLOB_FLAG
           
static short CHARSET_BINARY
           
static short CHARSET_UTF8
           
static int CLIENT_COMPRESS
           
static int CLIENT_CONNECT_WITH_DB
           
static int CLIENT_FOUND_ROWS
           
static int CLIENT_IGNORE_SIGPIPE
           
static int CLIENT_IGNORE_SPACE
           
static int CLIENT_INTERACTIVE
           
static int CLIENT_LOCAL_FILES
           
static int CLIENT_LONG_FLAG
           
static int CLIENT_LONG_PASSWORD
           
static int CLIENT_MULTI_RESULTS
           
static int CLIENT_MULTI_STATEMENTS
           
static int CLIENT_NO_SCHEMA
           
static int CLIENT_ODBC
           
static int CLIENT_PROTOCOL_41
           
static int CLIENT_RESERVED
           
static int CLIENT_SECURE_CONNECTION
           
static int CLIENT_SSL
           
static int CLIENT_TRANSACTIONS
           
static int COM_BINLOG_DUMP
           
static int COM_CHANGE_USER
           
static int COM_CONNECT
           
static int COM_CONNECT_OUT
           
static int COM_CREATE_DB
           
static int COM_DEBUG
           
static int COM_DELAYED_INSERT
           
static int COM_DROP_DB
           
static int COM_FIELD_LIST
           
static int COM_INIT_DB
           
static int COM_PING
           
static int COM_PROCESS_INFO
           
static int COM_PROCESS_KILL
           
static int COM_QUERY
           
static int COM_QUIT
           
static int COM_REFRESH
           
static int COM_REGISTER_SLAVE
           
static int COM_SET_OPTION
           
static int COM_SHUTDOWN
           
static int COM_SLEEP
           
static int COM_STATISTICS
           
static int COM_STMT_CLOSE
           
static int COM_STMT_EXECUTE
           
static int COM_STMT_FETCH
           
static int COM_STMT_PREPARE
           
static int COM_STMT_RESET
           
static int COM_STMT_SEND_LONG_DATA
           
static int COM_TABLE_DUMP
           
static int COM_TIME
           
static byte CURSOR_TYPE_FOR_UPDATE
           
static byte CURSOR_TYPE_NO_CURSOR
           
static byte CURSOR_TYPE_READ_ONLY
           
static byte CURSOR_TYPE_SCROLLABLE
           
static int ENUM_FLAG
           
static int ER_BAD_DB_ERROR
           
static int ER_CON_COUNT_ERROR
           
static int ER_DBACCESS_DENIED_ERROR
           
static int ER_LOST_CONNECTION
           
static int ER_NO
           
static int ER_NO_DB_ERROR
           
static int ER_NO_ERROR
           
static int ER_NOT_SUPPORTED_YET
           
static int ER_OUTOFMEMORY
           
static int ER_SERVER_GONE_AWAY
           
static int ER_TOO_MANY_USER_CONNECTIONS
           
static int ER_UNKNOWN_ERROR
           
static int ER_UNKNOWN_STMT_HANDLER
           
static int ER_WRONG_ARGUMENTS
           
static int MULTIPLE_KEY_FLAG
           
static int MYSQL_LONG_DATA_HEADER
          size of the long data header
static byte MYSQL_TYPE_BIT
           
static byte MYSQL_TYPE_BLOB
           
static byte MYSQL_TYPE_DATE
           
static byte MYSQL_TYPE_DATETIME
           
static byte MYSQL_TYPE_DECIMAL
           
static byte MYSQL_TYPE_DOUBLE
           
static byte MYSQL_TYPE_ENUM
           
static byte MYSQL_TYPE_FLOAT
           
static byte MYSQL_TYPE_GEOMETRY
           
static byte MYSQL_TYPE_INT24
           
static byte MYSQL_TYPE_LONG
           
static byte MYSQL_TYPE_LONG_BLOB
           
static byte MYSQL_TYPE_LONGLONG
           
static byte MYSQL_TYPE_MEDIUM_BLOB
           
static byte MYSQL_TYPE_NEWDATE
           
static byte MYSQL_TYPE_NEWDECIMAL
           
static byte MYSQL_TYPE_NULL
           
static byte MYSQL_TYPE_SET
           
static byte MYSQL_TYPE_SHORT
           
static byte MYSQL_TYPE_STRING
           
static byte MYSQL_TYPE_TIME
           
static byte MYSQL_TYPE_TIMESTAMP
           
static byte MYSQL_TYPE_TINY
           
static byte MYSQL_TYPE_TINY_BLOB
           
static byte MYSQL_TYPE_VAR_STRING
           
static byte MYSQL_TYPE_VARCHAR
           
static byte MYSQL_TYPE_YEAR
           
static int NO_DEFAULT_VALUE_FLAG
           
static int NOT_NULL_FLAG
           
static int NUM_FLAG
           
static int PRI_KEY_FLAG
           
static short SERVER_MORE_RESULTS_EXISTS
           
static short SERVER_QUERY_NO_GOOD_INDEX_USED
           
static short SERVER_QUERY_NO_INDEX_USED
           
static short SERVER_STATUS_AUTOCOMMIT
           
static short SERVER_STATUS_CURSOR_EXISTS
           
static short SERVER_STATUS_IN_TRANS
           
static short SERVER_STATUS_LAST_ROW_SENT
           
static int SET_FLAG
           
static java.lang.String SQL_STATE_COMMUNICATION_ERROR
           
static int TIMESTAMP_FLAG
           
static int UNIQUE_KEY_FLAG
           
static int UNSIGNED_FLAG
           
static int ZEROFILL_FLAG
           
 
Method Summary
static java.lang.String commandToString(int command)
          Converts the given command number into a human readable string
static java.lang.String getSqlState(java.lang.Integer mysqlErrorCode)
          Get the SQLSTATE corresponding to the MySQL errorcode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COM_SLEEP

public static final int COM_SLEEP
See Also:
Constant Field Values

COM_QUIT

public static final int COM_QUIT
See Also:
Constant Field Values

COM_INIT_DB

public static final int COM_INIT_DB
See Also:
Constant Field Values

COM_QUERY

public static final int COM_QUERY
See Also:
Constant Field Values

COM_FIELD_LIST

public static final int COM_FIELD_LIST
See Also:
Constant Field Values

COM_CREATE_DB

public static final int COM_CREATE_DB
See Also:
Constant Field Values

COM_DROP_DB

public static final int COM_DROP_DB
See Also:
Constant Field Values

COM_REFRESH

public static final int COM_REFRESH
See Also:
Constant Field Values

COM_SHUTDOWN

public static final int COM_SHUTDOWN
See Also:
Constant Field Values

COM_STATISTICS

public static final int COM_STATISTICS
See Also:
Constant Field Values

COM_PROCESS_INFO

public static final int COM_PROCESS_INFO
See Also:
Constant Field Values

COM_CONNECT

public static final int COM_CONNECT
See Also:
Constant Field Values

COM_PROCESS_KILL

public static final int COM_PROCESS_KILL
See Also:
Constant Field Values

COM_DEBUG

public static final int COM_DEBUG
See Also:
Constant Field Values

COM_PING

public static final int COM_PING
See Also:
Constant Field Values

COM_TIME

public static final int COM_TIME
See Also:
Constant Field Values

COM_DELAYED_INSERT

public static final int COM_DELAYED_INSERT
See Also:
Constant Field Values

COM_CHANGE_USER

public static final int COM_CHANGE_USER
See Also:
Constant Field Values

COM_BINLOG_DUMP

public static final int COM_BINLOG_DUMP
See Also:
Constant Field Values

COM_TABLE_DUMP

public static final int COM_TABLE_DUMP
See Also:
Constant Field Values

COM_CONNECT_OUT

public static final int COM_CONNECT_OUT
See Also:
Constant Field Values

COM_REGISTER_SLAVE

public static final int COM_REGISTER_SLAVE
See Also:
Constant Field Values

COM_STMT_PREPARE

public static final int COM_STMT_PREPARE
See Also:
Constant Field Values

COM_STMT_EXECUTE

public static final int COM_STMT_EXECUTE
See Also:
Constant Field Values

COM_STMT_SEND_LONG_DATA

public static final int COM_STMT_SEND_LONG_DATA
See Also:
Constant Field Values

COM_STMT_CLOSE

public static final int COM_STMT_CLOSE
See Also:
Constant Field Values

COM_STMT_RESET

public static final int COM_STMT_RESET
See Also:
Constant Field Values

COM_SET_OPTION

public static final int COM_SET_OPTION
See Also:
Constant Field Values

COM_STMT_FETCH

public static final int COM_STMT_FETCH
See Also:
Constant Field Values

CLIENT_LONG_PASSWORD

public static final int CLIENT_LONG_PASSWORD
See Also:
Constant Field Values

CLIENT_FOUND_ROWS

public static final int CLIENT_FOUND_ROWS
See Also:
Constant Field Values

CLIENT_LONG_FLAG

public static final int CLIENT_LONG_FLAG
See Also:
Constant Field Values

CLIENT_CONNECT_WITH_DB

public static final int CLIENT_CONNECT_WITH_DB
See Also:
Constant Field Values

CLIENT_NO_SCHEMA

public static final int CLIENT_NO_SCHEMA
See Also:
Constant Field Values

CLIENT_COMPRESS

public static final int CLIENT_COMPRESS
See Also:
Constant Field Values

CLIENT_ODBC

public static final int CLIENT_ODBC
See Also:
Constant Field Values

CLIENT_LOCAL_FILES

public static final int CLIENT_LOCAL_FILES
See Also:
Constant Field Values

CLIENT_IGNORE_SPACE

public static final int CLIENT_IGNORE_SPACE
See Also:
Constant Field Values

CLIENT_PROTOCOL_41

public static final int CLIENT_PROTOCOL_41
See Also:
Constant Field Values

CLIENT_INTERACTIVE

public static final int CLIENT_INTERACTIVE
See Also:
Constant Field Values

CLIENT_SSL

public static final int CLIENT_SSL
See Also:
Constant Field Values

CLIENT_IGNORE_SIGPIPE

public static final int CLIENT_IGNORE_SIGPIPE
See Also:
Constant Field Values

CLIENT_TRANSACTIONS

public static final int CLIENT_TRANSACTIONS
See Also:
Constant Field Values

CLIENT_RESERVED

public static final int CLIENT_RESERVED
See Also:
Constant Field Values

CLIENT_SECURE_CONNECTION

public static final int CLIENT_SECURE_CONNECTION
See Also:
Constant Field Values

CLIENT_MULTI_STATEMENTS

public static final int CLIENT_MULTI_STATEMENTS
See Also:
Constant Field Values

CLIENT_MULTI_RESULTS

public static final int CLIENT_MULTI_RESULTS
See Also:
Constant Field Values

SERVER_STATUS_IN_TRANS

public static final short SERVER_STATUS_IN_TRANS
See Also:
Constant Field Values

SERVER_STATUS_AUTOCOMMIT

public static final short SERVER_STATUS_AUTOCOMMIT
See Also:
Constant Field Values

SERVER_MORE_RESULTS_EXISTS

public static final short SERVER_MORE_RESULTS_EXISTS
See Also:
Constant Field Values

SERVER_QUERY_NO_GOOD_INDEX_USED

public static final short SERVER_QUERY_NO_GOOD_INDEX_USED
See Also:
Constant Field Values

SERVER_QUERY_NO_INDEX_USED

public static final short SERVER_QUERY_NO_INDEX_USED
See Also:
Constant Field Values

SERVER_STATUS_CURSOR_EXISTS

public static final short SERVER_STATUS_CURSOR_EXISTS
See Also:
Constant Field Values

SERVER_STATUS_LAST_ROW_SENT

public static final short SERVER_STATUS_LAST_ROW_SENT
See Also:
Constant Field Values

NOT_NULL_FLAG

public static final int NOT_NULL_FLAG
See Also:
Constant Field Values

PRI_KEY_FLAG

public static final int PRI_KEY_FLAG
See Also:
Constant Field Values

UNIQUE_KEY_FLAG

public static final int UNIQUE_KEY_FLAG
See Also:
Constant Field Values

MULTIPLE_KEY_FLAG

public static final int MULTIPLE_KEY_FLAG
See Also:
Constant Field Values

BLOB_FLAG

public static final int BLOB_FLAG
See Also:
Constant Field Values

UNSIGNED_FLAG

public static final int UNSIGNED_FLAG
See Also:
Constant Field Values

ZEROFILL_FLAG

public static final int ZEROFILL_FLAG
See Also:
Constant Field Values

BINARY_FLAG

public static final int BINARY_FLAG
See Also:
Constant Field Values

ENUM_FLAG

public static final int ENUM_FLAG
See Also:
Constant Field Values

AUTO_INCREMENT_FLAG

public static final int AUTO_INCREMENT_FLAG
See Also:
Constant Field Values

TIMESTAMP_FLAG

public static final int TIMESTAMP_FLAG
See Also:
Constant Field Values

SET_FLAG

public static final int SET_FLAG
See Also:
Constant Field Values

NO_DEFAULT_VALUE_FLAG

public static final int NO_DEFAULT_VALUE_FLAG
See Also:
Constant Field Values

NUM_FLAG

public static final int NUM_FLAG
See Also:
Constant Field Values

CHARSET_BINARY

public static final short CHARSET_BINARY
See Also:
Constant Field Values

CHARSET_UTF8

public static final short CHARSET_UTF8
See Also:
Constant Field Values

CURSOR_TYPE_NO_CURSOR

public static final byte CURSOR_TYPE_NO_CURSOR
See Also:
Constant Field Values

CURSOR_TYPE_READ_ONLY

public static final byte CURSOR_TYPE_READ_ONLY
See Also:
Constant Field Values

CURSOR_TYPE_FOR_UPDATE

public static final byte CURSOR_TYPE_FOR_UPDATE
See Also:
Constant Field Values

CURSOR_TYPE_SCROLLABLE

public static final byte CURSOR_TYPE_SCROLLABLE
See Also:
Constant Field Values

MYSQL_TYPE_DECIMAL

public static final byte MYSQL_TYPE_DECIMAL
See Also:
Constant Field Values

MYSQL_TYPE_TINY

public static final byte MYSQL_TYPE_TINY
See Also:
Constant Field Values

MYSQL_TYPE_SHORT

public static final byte MYSQL_TYPE_SHORT
See Also:
Constant Field Values

MYSQL_TYPE_LONG

public static final byte MYSQL_TYPE_LONG
See Also:
Constant Field Values

MYSQL_TYPE_FLOAT

public static final byte MYSQL_TYPE_FLOAT
See Also:
Constant Field Values

MYSQL_TYPE_DOUBLE

public static final byte MYSQL_TYPE_DOUBLE
See Also:
Constant Field Values

MYSQL_TYPE_NULL

public static final byte MYSQL_TYPE_NULL
See Also:
Constant Field Values

MYSQL_TYPE_TIMESTAMP

public static final byte MYSQL_TYPE_TIMESTAMP
See Also:
Constant Field Values

MYSQL_TYPE_LONGLONG

public static final byte MYSQL_TYPE_LONGLONG
See Also:
Constant Field Values

MYSQL_TYPE_INT24

public static final byte MYSQL_TYPE_INT24
See Also:
Constant Field Values

MYSQL_TYPE_DATE

public static final byte MYSQL_TYPE_DATE
See Also:
Constant Field Values

MYSQL_TYPE_TIME

public static final byte MYSQL_TYPE_TIME
See Also:
Constant Field Values

MYSQL_TYPE_DATETIME

public static final byte MYSQL_TYPE_DATETIME
See Also:
Constant Field Values

MYSQL_TYPE_YEAR

public static final byte MYSQL_TYPE_YEAR
See Also:
Constant Field Values

MYSQL_TYPE_NEWDATE

public static final byte MYSQL_TYPE_NEWDATE
See Also:
Constant Field Values

MYSQL_TYPE_VARCHAR

public static final byte MYSQL_TYPE_VARCHAR
See Also:
Constant Field Values

MYSQL_TYPE_BIT

public static final byte MYSQL_TYPE_BIT
See Also:
Constant Field Values

MYSQL_TYPE_NEWDECIMAL

public static final byte MYSQL_TYPE_NEWDECIMAL
See Also:
Constant Field Values

MYSQL_TYPE_ENUM

public static final byte MYSQL_TYPE_ENUM
See Also:
Constant Field Values

MYSQL_TYPE_SET

public static final byte MYSQL_TYPE_SET
See Also:
Constant Field Values

MYSQL_TYPE_TINY_BLOB

public static final byte MYSQL_TYPE_TINY_BLOB
See Also:
Constant Field Values

MYSQL_TYPE_MEDIUM_BLOB

public static final byte MYSQL_TYPE_MEDIUM_BLOB
See Also:
Constant Field Values

MYSQL_TYPE_LONG_BLOB

public static final byte MYSQL_TYPE_LONG_BLOB
See Also:
Constant Field Values

MYSQL_TYPE_BLOB

public static final byte MYSQL_TYPE_BLOB
See Also:
Constant Field Values

MYSQL_TYPE_VAR_STRING

public static final byte MYSQL_TYPE_VAR_STRING
See Also:
Constant Field Values

MYSQL_TYPE_STRING

public static final byte MYSQL_TYPE_STRING
See Also:
Constant Field Values

MYSQL_TYPE_GEOMETRY

public static final byte MYSQL_TYPE_GEOMETRY
See Also:
Constant Field Values

ER_NO_ERROR

public static final int ER_NO_ERROR
See Also:
Constant Field Values

ER_NO

public static final int ER_NO
See Also:
Constant Field Values

ER_DBACCESS_DENIED_ERROR

public static final int ER_DBACCESS_DENIED_ERROR
See Also:
Constant Field Values

ER_BAD_DB_ERROR

public static final int ER_BAD_DB_ERROR
See Also:
Constant Field Values

ER_TOO_MANY_USER_CONNECTIONS

public static final int ER_TOO_MANY_USER_CONNECTIONS
See Also:
Constant Field Values

ER_WRONG_ARGUMENTS

public static final int ER_WRONG_ARGUMENTS
See Also:
Constant Field Values

ER_NOT_SUPPORTED_YET

public static final int ER_NOT_SUPPORTED_YET
See Also:
Constant Field Values

ER_UNKNOWN_STMT_HANDLER

public static final int ER_UNKNOWN_STMT_HANDLER
See Also:
Constant Field Values

ER_OUTOFMEMORY

public static final int ER_OUTOFMEMORY
See Also:
Constant Field Values

ER_NO_DB_ERROR

public static final int ER_NO_DB_ERROR
See Also:
Constant Field Values

ER_UNKNOWN_ERROR

public static final int ER_UNKNOWN_ERROR
See Also:
Constant Field Values

ER_LOST_CONNECTION

public static final int ER_LOST_CONNECTION
See Also:
Constant Field Values

ER_SERVER_GONE_AWAY

public static final int ER_SERVER_GONE_AWAY
See Also:
Constant Field Values

ER_CON_COUNT_ERROR

public static final int ER_CON_COUNT_ERROR
See Also:
Constant Field Values

MYSQL_LONG_DATA_HEADER

public static final int MYSQL_LONG_DATA_HEADER
size of the long data header

See Also:
Constant Field Values

SQL_STATE_COMMUNICATION_ERROR

public static final java.lang.String SQL_STATE_COMMUNICATION_ERROR
See Also:
Constant Field Values
Method Detail

commandToString

public static java.lang.String commandToString(int command)
Converts the given command number into a human readable string

Parameters:
command - command number to convert, one of COM_XXX above
Returns:
a string representing the given command constant name

getSqlState

public static java.lang.String getSqlState(java.lang.Integer mysqlErrorCode)
Get the SQLSTATE corresponding to the MySQL errorcode.

Parameters:
mysqlErrorCode - the errorcode for which we want the corresponding SQLSTATE
Returns:
String for the corresponding SQLSTATE. null if the SQLSTATE is not defined in our constants.