public class Mysqli extends JdbcConnectionResource
Modifier and Type | Class and Description |
---|---|
static class |
Mysqli.LastSqlType |
_conn, _driver, _flags, _host, _isEmulatePrepares, _port, _socket, _sqlParseToken, _url
Modifier | Constructor and Description |
---|---|
protected |
Mysqli(Env env) |
|
Mysqli(Env env,
StringValue host,
StringValue user,
StringValue password,
java.lang.String db,
int port,
StringValue socket)
This is the constructor for the mysqli class.
|
Modifier and Type | Method and Description |
---|---|
int |
affected_rows(Env env)
returns the number of affected rows.
|
boolean |
autocommit(Env env,
boolean isAutoCommit)
sets the autocommit mode
|
boolean |
change_user(Env env,
java.lang.String user,
java.lang.String password,
java.lang.String db)
Changes the user and database
|
StringValue |
character_set_name(Env env)
Returns the client encoding.
|
StringValue |
client_encoding(Env env)
Alias for character_set_name
|
boolean |
close(Env env) |
protected ConnectionEntry |
connectImpl(Env env,
java.lang.String host,
java.lang.String user,
java.lang.String pass,
java.lang.String dbname,
int port,
java.lang.String socket,
int flags,
java.lang.String driver,
java.lang.String url,
boolean isNewLink,
boolean isEmulatePrepares)
Connects to the underlying database.
|
protected JdbcResultResource |
createResult(java.sql.Statement stmt,
java.sql.ResultSet rs)
Creates a database-specific result.
|
protected JdbcStatementResource |
createStatementResource(Env env) |
int |
errno()
Returns the error code for the most recent function call
|
StringValue |
escape_string(Env env,
StringValue str)
Escapes the string
|
int |
field_count(Env env)
Returns the number of columns in the last query.
|
Value |
get_charset(Env env) |
java.lang.String |
get_client_info(Env env) |
Value |
get_dbname(Env env)
Returns the database name.
|
StringValue |
get_host_info(Env env)
Returns the host information.
|
StringValue |
get_host_name(Env env)
Returns the host name.
|
int |
get_port_number()
Returns the port number.
|
int |
get_proto_info()
Returns the protocol information.
|
StringValue |
get_server_info(Env env)
Returns the server information.
|
int |
get_server_version(Env env)
Returns the server information.
|
int |
getaffected_rows(Env env)
Quercus function to get the field 'affected_rows'.
|
java.lang.String |
getclient_info(Env env)
Quercus function to get the field 'client_info'.
|
int |
getclient_version(Env env)
Quercus function to get the field 'client_version'.
|
protected java.lang.String |
getClientInfo(Env env) |
protected static java.lang.String |
getClientInfoStatic(Env env) |
protected java.lang.String |
getDriverName() |
int |
geterrno()
Quercus function to get the field 'errno'.
|
StringValue |
geterror(Env env)
Quercus function to get the field 'error'.
|
int |
getfield_count(Env env)
Quercus function to get the field 'field_count'.
|
StringValue |
gethost_info(Env env)
Quercus function to get the field 'host_info'.
|
Value |
getinfo(Env env)
Quercus function to get the field 'info'.
|
Value |
getinsert_id(Env env)
Quercus function to get the field 'insert_id'.
|
int |
getprotocol_version()
Quercus function to get the field 'protocol_version'.
|
StringValue |
getserver_info(Env env)
Quercus function to get the field 'server_info'.
|
int |
getserver_version(Env env)
Quercus function to get the field 'server_version'.
|
protected Value |
getServerStat(Env env) |
StringValue |
getsqlstate(Env env)
Quercus function to get the field 'sqlstate'.
|
Value |
getthread_id(Env env)
Quercus function to get the field 'thread_id'.
|
protected static java.lang.String |
getUrl(Env env,
java.lang.String host,
int port,
java.lang.String dbname,
java.lang.String encoding,
boolean useInteractive,
boolean useCompression,
boolean useSsl,
boolean isEmulatePrepares) |
int |
getwarning_count(Env env)
Quercus function to get the field 'warning_count'.
|
Value |
insert_id(Env env)
returns ID generated for an AUTO_INCREMENT column by the previous
INSERT query on success, 0 if the previous query does not generate
an AUTO_INCREMENT value, or FALSE if no MySQL connection was established
|
boolean |
isLastSqlDescribe() |
boolean |
kill(Env env,
int threadId)
Kills the given mysql thread id.
|
JdbcResultResource |
list_dbs(Env env) |
protected MysqliResult |
metaQuery(Env env,
java.lang.String sql,
java.lang.String catalog)
Used by the
various mysqli functions to query the database
for metadata about the resultset which is
not in ResultSetMetaData.
|
boolean |
more_results(Env env)
Check for more results in a multi-query
|
boolean |
multi_query(Env env,
StringValue query)
executes one or multiple queries which are
concatenated by a semicolon.
|
boolean |
next_result(Env env)
prepares next result set from a previous call to
mysqli_multi_query
|
boolean |
options(Env env,
int option,
Value value)
Sets a mysqli option.
|
MysqliStatement |
prepare(Env env,
java.lang.String query)
returns a prepared statement or null on error.
|
Value |
query(Env env,
StringValue sqlV,
int resultMode)
Executes a query.
|
boolean |
real_connect(Env env,
StringValue host,
StringValue userName,
StringValue password,
StringValue dbname,
int port,
StringValue socket,
int flags)
Connects to the underlying database.
|
StringValue |
real_escape_string(Env env,
StringValue str)
Escapes the string
|
boolean |
real_query(Env env,
StringValue query)
Execute an single query against the database whose result
can then be retrieved or stored using the mysqli_store_result()
or mysqli_use_result() functions.
|
protected Value |
realQuery(Env env,
java.lang.String sql)
Intercept Mysql specific query before sending to JDBC driver
to handle any special cases.
|
boolean |
rollback()
Rolls the current transaction back.
|
boolean |
select_db(Env env,
java.lang.String db)
Selects the underlying database/catalog to use.
|
boolean |
set_charset(Env env,
StringValue charset) |
boolean |
set_opt(Env env,
int option,
Value value)
Sets a mysqli option
|
void |
setPersistent() |
StringValue |
sqlstate(Env env)
Returns the SQLSTATE error
|
Value |
stat(Env env)
returns a string with the status of the connection
or FALSE if error
|
MysqliStatement |
stmt_init(Env env)
returns a statement for use with
mysqli_stmt_prepare
|
JdbcResultResource |
store_result(Env env)
Transfers the result set from the last query on the
database connection represented by conn.
|
boolean |
thread_safe()
Returns true for thread_safe
|
java.lang.String |
toString()
Converts to a string.
|
JdbcResultResource |
use_result(Env env)
Transfers the result set from the last query on the
database connection represented by conn.
|
int |
warning_count(Env env)
returns the number of warnings from the last query
in the connection object.
|
cleanup, clearErrors, close, closeStatement, commit, connectInternal, createJavaStatement, createStatement, error, getAffectedRows, getAutoCommit, getCatalog, getCatalogs, getCharacterSetName, getClientEncoding, getClientInfo, getConnection, getDbName, getDriver, getErrorCode, getErrorMessage, getException, getFieldCount, getHost, getHostInfo, getJavaConnection, getPassword, getPort, getResultResource, getResultSet, getServerInfo, getTableMetaData, getUrl, getURL, getUserName, getWarnings, infoToVersion, isConnected, isEmulatePrepares, isSeekable, keepResourceValues, keepStatementOpen, parseSqlToken, ping, realEscapeString, saveErrors, setAffectedRows, setAutoCommit, setCatalog, setClientEncoding, setResultResource, setWarnings, toObject, validateConnection
public Mysqli(Env env, StringValue host, StringValue user, StringValue password, java.lang.String db, int port, StringValue socket)
protected Mysqli(Env env)
public boolean isLastSqlDescribe()
protected ConnectionEntry connectImpl(Env env, java.lang.String host, java.lang.String user, java.lang.String pass, java.lang.String dbname, int port, java.lang.String socket, int flags, java.lang.String driver, java.lang.String url, boolean isNewLink, boolean isEmulatePrepares)
connectImpl
in class JdbcConnectionResource
protected static java.lang.String getUrl(Env env, java.lang.String host, int port, java.lang.String dbname, java.lang.String encoding, boolean useInteractive, boolean useCompression, boolean useSsl, boolean isEmulatePrepares)
public int getaffected_rows(Env env)
public int affected_rows(Env env)
public boolean autocommit(Env env, boolean isAutoCommit)
public boolean change_user(Env env, java.lang.String user, java.lang.String password, java.lang.String db)
user
- the new userpassword
- the new passworddb
- the new databasepublic StringValue character_set_name(Env env)
public StringValue client_encoding(Env env)
public int geterrno()
public int errno()
public StringValue geterror(Env env)
public StringValue escape_string(Env env, StringValue str)
public java.lang.String getclient_info(Env env)
public java.lang.String get_client_info(Env env)
protected static java.lang.String getClientInfoStatic(Env env)
protected java.lang.String getClientInfo(Env env)
getClientInfo
in class JdbcConnectionResource
public int getclient_version(Env env)
public StringValue gethost_info(Env env)
public StringValue get_host_info(Env env)
public StringValue get_host_name(Env env)
public int get_port_number()
public int getprotocol_version()
public int get_proto_info()
public StringValue getserver_info(Env env)
public StringValue get_server_info(Env env)
public int getserver_version(Env env)
public int get_server_version(Env env)
public int getfield_count(Env env)
public int field_count(Env env)
public Value insert_id(Env env)
public JdbcResultResource list_dbs(Env env)
public boolean more_results(Env env)
public boolean multi_query(Env env, StringValue query)
public boolean next_result(Env env)
public Value query(Env env, StringValue sqlV, int resultMode)
env
- the PHP executing environmentsql
- the escaped query string (can contain
escape sequences like `\n' and `\Z')resultMode
- ignoredJdbcResultResource
, or null for failureprotected Value realQuery(Env env, java.lang.String sql)
realQuery
in class JdbcConnectionResource
public boolean real_query(Env env, StringValue query)
env
- the PHP executing environmentquery
- the escaped query string (can contain
escape sequences like `\n' and `\Z')public MysqliStatement prepare(Env env, java.lang.String query)
prepare
in class JdbcConnectionResource
protected JdbcStatementResource createStatementResource(Env env)
createStatementResource
in class JdbcConnectionResource
public boolean real_connect(Env env, StringValue host, StringValue userName, StringValue password, StringValue dbname, int port, StringValue socket, int flags)
public StringValue real_escape_string(Env env, StringValue str)
public boolean rollback()
rollback
in class JdbcConnectionResource
public boolean select_db(Env env, java.lang.String db)
dbname
- the name of the database to select.public StringValue getsqlstate(Env env)
public StringValue sqlstate(Env env)
protected java.lang.String getDriverName()
getDriverName
in class JdbcConnectionResource
public boolean set_charset(Env env, StringValue charset)
protected Value getServerStat(Env env)
getServerStat
in class JdbcConnectionResource
public Value stat(Env env)
public MysqliStatement stmt_init(Env env)
public JdbcResultResource store_result(Env env)
public boolean kill(Env env, int threadId)
public boolean thread_safe()
public JdbcResultResource use_result(Env env)
public int getwarning_count(Env env)
public int warning_count(Env env)
protected JdbcResultResource createResult(java.sql.Statement stmt, java.sql.ResultSet rs)
createResult
in class JdbcConnectionResource
protected MysqliResult metaQuery(Env env, java.lang.String sql, java.lang.String catalog)
public void setPersistent()
public boolean close(Env env)
public java.lang.String toString()
toString
in class JdbcConnectionResource